В статье "Filtering Bridge with IP Filter on FreeBSD" описано как в FreeBSD активировать функцию бриджинга и настроить фаервол (IP Filter) для фильтрации пакетов проходящих через бридж. Кратко, самое интересное:
Конфигурация ядра
options BRIDGE
options IPFILTER
Настройка бриджа между xl0 и xl1, в /etc/sysctl.conf
sysctl net.link.ether.bridge_cfg=xl0:0,xl1:0
sysctl net.link.ether.bridge_ipf=1
sysctl net.link.ether.bridge=1
Включение IP Filter, /etc/rc.conf
ipfilter_enable="YES"
Правила фильтрации:
pass in quick on xl0 proto tcp from any to 131.211.83.40 port = 22 flags S keep state
pass in quick on xl0 proto tcp from any to 131.211.83.40 port = 80 flags S keep state
pass in quick on xl1 proto tcp from any to any keep state
pass in quick on xl1 proto udp from any to any keep state
pass in quick on xl1 proto icmp from any to any keep state
block in on xl0 from any to 131.211.83.4
|