Код: Выделить всё
#!/bin/sh
ipfw="/sbin/ipfw -q"
ourlan="192.168.0.0/24"
dns="82.209.200.16,82.209.200.17,82.209.240.241,82.209.243.241"
/sbin/ipfw disable firewall
${ipfw} flush
${ipfw} add 50 fwd 192.168.0.1,8080 ip from any to me 80 in
${ipfw} add 51 fwd 192.168.0.1,8021 ip from any to me 21 in
${ipfw} add 52 fwd 82.209.200.17,domain ip from ${ourlan} to me domain in
${ipfw} add 53 fwd 192.168.0.1:3128 ip from not me to not me 80 in via nfe0 keep-state
${ipfw} add 100 allow all from any to me dst-port ssh,http,8080,pptp,65500-65534
${ipfw} add 110 allow all from ${ourlan} to me
${ipfw} add 115 allow udp from ${ourlan} to any dst-port 137,138 in via nfe0
${ipfw} add 120 allow all from any to any bootps,domain,tftp in via nfe0
${ipfw} add 125 deny icmp from not me to any in icmptype 5,9,13,14,15,16,17
${ipfw} add 150 check-state
# Neverwinter nights official server blocking
${ipfw} add 155 deny all from any to not ${ourlan} dst-port 5121
# ${ipfw} add 160 allow all from me to any out keep-state
${ipfw} add 202 allow icmp from any to any
${ipfw} add 400 allow all from ${ourlan} to ${dns} dst-port domain keep-state
${ipfw} add 410 allow all from ${ourlan} to any dst-port ircd keep-state
${ipfw} add 500 allow all from me to ${ourlan} out keep-state
#${ipfw} add 1000 prob 0.5 skipto 1500 ip from me to not ${ourlan} out
#${ipfw} add 1450 fwd 192.168.0.253 all from me to not ${ourlan} out keep-state
#${ipfw} add 1500 fwd 82.209.200.37 all from me to not ${ourlan} out keep-state
${ipfw} add 2500 allow all from me to any out keep-state
${ipfw} add 65534 deny log all from any to any
/sbin/ipfw enable firewall
192.168.0.253 - ADSL-роутер с поднятым PPPoE
82.209.200.37 - маршрут провайдера на поднятом PPPoE из pppd
Ткните кто-нибудь уснувшего за клавой, что не так?