Код: Выделить всё
00100 check-state
00200 allow ip from any to any via lo0
00300 deny ip from any to 127.0.0.0/8
00400 deny ip from 127.0.0.0/8 to any
00500 deny ip from any to 172.16.0.0/12 in via vr0
00600 deny ip from any to 192.168.0.0/16 in via vr0
00700 deny ip from any to 0.0.0.0/8 in via vr0
00800 deny ip from any to 169.254.0.0/16 in via vr0
00900 deny ip from any to 240.0.0.0/4 in via vr0
01000 deny icmp from any to any frag
01100 deny icmp from any to 255.255.255.255 in via vr0
01200 deny icmp from any to 255.255.255.255 out via vr0
01300 fwd 10.1.171.2,3128 tcp from 192.168.0.0/24 to any dst-port 80 via vr0
01400 fwd 10.1.171.2,3128 tcp from 192.168.5.0/24 to any dst-port 80 via vr0
01500 netgraph 1 ip from 192.168.0.66 to any out via vr0
01600 netgraph 1 ip from 192.168.5.0/24 to any out via vr0
01700 netgraph 10 ip from any to 10.1.171.2 in via vr0
01800 deny ip from 172.16.0.0/12 to any out via vr0
01900 deny ip from 192.168.0.0/16 to any out via vr0
02000 deny ip from 0.0.0.0/8 to any out via vr0
02100 deny ip from 169.254.0.0/16 to any out via vr0
02200 deny ip from 224.0.0.0/4 to any out via vr0
02300 deny ip from 240.0.0.0/4 to any out via vr0
02400 allow udp from any 53 to any via vr0
02500 allow udp from any to any dst-port 123 via vr0
02600 allow tcp from any to any established
02700 allow icmp from any to any icmptypes 0,8,11
02800 allow gre from any to any via dc0
02900 allow tcp from any to me dst-port 1723 via dc0
03000 allow tcp from any to any via dc0
03100 allow udp from any to any via dc0
03200 allow icmp from any to any via dc0
03300 allow ip from 10.1.171.2 to any out xmit vr0
03400 allow ip from any to any in via ng*
03500 allow ip from any to any out via ng*
03600 deny log logamount 1000 ip from any to any
65535 deny ip from any to any
Код: Выделить всё
/usr/sbin/ngctl -f- <<-SEQ
mkpeer ipfw: netflow 1 iface0
name ipfw:1 netflow
mkpeer netflow: split out0 in
name netflow:out0 split1
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/$ngnat_export
connect split1: netflow: out iface1
connect ipfw: netflow: 5 out1
mkpeer split1: nat mixed out
name split1:mixed nat1
connect ipfw: nat1: 10 in
msg nat1: setaliasaddr $ngnat_aliasaddr1
msg netflow: setdlt { iface=0 dlt=12 }
msg netflow: setifindex { iface=0 index=1001 }
msg netflow: setdlt { iface=1 dlt=12 }
msg netflow: setifindex { iface=1 index=1002 }