Код: Выделить всё
# uname -r
7.2-RELEASE-p3
Код: Выделить всё
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1b:21:35:6b:69
inet 192.168.0.3 netmask 0xffffff00 broadcast 192.168.0.255
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
inet 10.0.1.3 netmask 0xffffff00 broadcast 10.0.1.255
inet 10.0.2.3 netmask 0xffffff00 broadcast 10.0.2.255
inet 10.0.0.3 netmask 0xffffff00 broadcast 10.0.0.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1b:21:35:6b:d9
inet ip1 netmask 0xfffffffc broadcast 217.27.150.191
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
Код: Выделить всё
# ipfw list
00150 allow ip from any to any via lo0
00151 allow ip from 192.168.0.0/24 to 192.168.1.0/24,10.0.0.0/24 via em0 keep-state
00152 allow ip from 192.168.1.0/24 to 192.168.0.0/24,10.0.0.0/24 via em0 keep-state
00153 allow ip from 10.0.0.0/24 to 192.168.0.0/24,192.168.1.0/24 via em0 keep-state
00200 allow ip from me to any keep-state
00201 check-state
00260 allow ip from any to any via em1 out
00310 allow tcp from any to me dst-port 80,1326,443,1327,1328,9219
00312 allow udp from any to me dst-port 161 via em0
00330 allow icmp from any to any via em0
00340 allow udp from any to me dst-port 53 via em0
00350 allow udp from any to me dst-port 27015 via em1
00384 allow tcp from any to any dst-port 110,25,8100
00400 deny ip from any to me
00450 allow ip from any to any via em1 in
40001 pipe 8 ip from table(2) to 192.168.0.22
40001 pipe 9 ip from 192.168.0.22 to table(2)
40001 pipe 10 ip from any to 192.168.0.22
40001 pipe 11 ip from 192.168.0.22 to any
40002 pipe 12 ip from table(2) to 192.168.0.13
40002 pipe 13 ip from 192.168.0.13 to table(2)
40002 pipe 14 ip from any to 192.168.0.13
40002 pipe 15 ip from 192.168.0.13 to any
...
60000 deny ip from any to any
65535 deny ip from any to any
Код: Выделить всё
# joe /etc/ipnat
rdr em1 ip1/32 port 80 -> 10.0.0.1 port 80 tcp
rdr em1 ip1/32 port 27015 -> 192.168.0.6 port 27015 udp
rdr em1 ip1/32 port 1327 -> 192.168.0.6 port 22 tcp
rdr em1 ip1/32 port 1328 -> 10.0.0.1 port 22 tcp
rdr em1 ip1/32 port 9219 -> 192.168.0.4 port 9219 tcp
bimap em1 192.168.0.13/24 -> ip2/32
bimap em1 192.168.0.26/24 -> ip3/32
bimap em1 192.168.0.73/24 -> ip4/32
bimap em1 192.168.0.54/24 -> ip5/32
map em1 192.168.0.0/24 -> ip6/32 portmap tcp/udp 40000:60000
map em1 192.168.1.0/24 -> ip7/32 portmap tcp/udp 40000:60000
map em1 10.0.0.0/24 -> ip8/32 portmap tcp/udp 40000:60000
map em1 192.168.0.0/24 -> ip1/32 icmpidmap icmp 64000:65535
map em1 192.168.1.0/24 -> ip1/32 icmpidmap icmp 64000:65535
map em1 10.0.0.0/24 -> ip1/32 icmpidmap icmp 64000:65535
Код: Выделить всё
# joe /var/log/messages
Oct 3 11:45:00 Bill kernel: ipfw: install_state: entry already present, done
Oct 3 11:46:13 Bill kernel: ipfw: install_state: entry already present, done
Oct 3 11:50:05 Bill kernel: ipfw: install_state: entry already present, done
Oct 3 11:56:08 Bill last message repeated 2 times