Собрать ядро с опциями
options IPFIREWALL options DUMMYNET options IPDIVERT
/etc/rc.conf
gateway_enable="YES" firewall_enable="YES" firewall_type="OPEN" natd_enable="YES" natd_interface="fxp0" natd_flags=""
fxp0 - Инерфейс смотрящий в мир.
Перезапуск сетевых сервисов
# /etc/netstart
/etc/sysctl.conf
net.inet.ip.fastforwarding=1 net.inet.ip.portrange.randomized=0 net.inet.tcp.nolocaltimewait=1 kern.ipc.nmbclusters=65536 kern.ipc.maxsockets=204800 net.inet.ip.dummynet.hash_size=512 kern.ipc.somaxconn=4096 net.inet.tcp.maxtcptw=40960 net.inet.tcp.nolocaltimewait=1 net.inet.ip.portrange.randomized=0