rc.conf
Код: Выделить всё
ifconfig_em0="inet 192.168.1.26 netmask 255.255.255.0"
ifconfig_em0_alias0="inet 192.168.0.31 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/etc/firewall"
Код: Выделить всё
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPDIVERT
options DUMMYNET
Код: Выделить всё
#!/bin/sh
fw="/sbin/ipfw -q"
nmask="24"
ofnet="192.168.1"
devnet="192.168.0"
${fw} -f flush
${fw} -f pipe flush
${fw} -f queue flush
${fw} add allow ip from any to any via lo0
${fw} add allow ip from ${ofnet}.2 to any
${fw} add allow ip from any to ${ofnet}.2
${fw} add allow ip from ${ofnet}.123 to ${ofnet}.26
${fw} add allow ip from ${ofnet}.26 to ${ofnet}.123