Написал тут правила IPFW для маршрутизатора (FreeBSD 4.5), все вроде работает как нужно (http, ftp, smtp, pop3, нету https пока). Хотелось бы, чтобы посмотрев ниже приведенные правила, оставили комментарии (что, где подкорректировать надо, если надо).
fxp0-внутренний интерфейс (192.168.0.0/24)
xl0-внешний интерфейс (195.x.x.x)
-f flush
add 100 deny log all from 192.168.0.0/24 to any out via xl0
add 100 deny log all from any to 127.0.0.0/8
add 200 deny log all from 127.0.0.0/8 to any
#STOP SPOOFING
add 300 deny log all from 192.168.0.0/24 to any in via xl0
add 400 deny log all from any to 10.0.0.0/8 via xl0
add 500 deny log all from any to 172.16.0.0/12 via xl0
add 600 deny log all from any to 192.168.0.0/24 via xl0
add 700 deny log all from any to 127.0.0.0/8 via xl0
add 800 deny log all from any to 0.0.0.0/8 via xl0
add 900 deny log all from any to 255.255.255.255 via xl0
add 1000 deny log all from any to 169.254.0.0/16 via xl0
add 1100 deny log all from any to 192.0.2.0/24 via xl0
add 1200 deny log all from any to 224.0.0.0/4 via xl0
add 1300 deny log all from any to 240.0.0.0/4 via xl0
add 1400 deny log tcp from any to any via xl0 frag
add 1500 deny log icmp from any to any via xl0 frag
add 1600 deny log udp from any to any via xl0 frag
add 1700 deny log tcp from any to any 1-1023 in via xl0
add 1800 deny log udp from any to any 1-1023 in via xl0
add 1900 divert natd ip from 192.168.0.0/24 to any out via xl0
add 1950 divert natd ip from any to 195.239.137.3 in via xl0
add 2000 allow all from any to any via lo0
add 2100 allow icmp from any to any via fxp0
add 2200 allow udp from any 1024-65535 to any in via fxp0
add 2300 allow udp from any to any 1024-65535 out via fxp0
add 2400 allow tcp from any 1024-65535 to any in via fxp0
add 2500 allow tcp from any to any 1024-65535 out via fxp0
add 2600 allow udp from any 1024-65535 to any 53 out via xl0
add 2700 allow udp from any 53 to any 1024-65535 in via xl0
add 2800 allow tcp from any 1024-65535 to any 80 out via xl0
add 2900 allow tcp from any 80 to any 1024-65535 in via xl0
add 3000 allow tcp from any 1024-65535 to any 21 out via xl0
add 3100 allow tcp from any 21 to any 1024-65535 in via xl0
add 3200 allow tcp from any 1024-65535 to any 110 out via xl0
add 3300 allow tcp from any 110 to any 1024-65535 in via xl0
add 3400 allow tcp from any 1024-65535 to any 25 out via xl0
add 3500 allow tcp from any 25 to any 1024-65535 in via xl0
add 3600 allow tcp from any 1024-65535 to any 1024-65535 out via xl0
add 3700 allow tcp from any 1024-65535 to any 1024-65535 in via xl0 tcpflags !syn
add 3800 deny all from any to any
|