Код: Выделить всё
/usr/home/fill/>vi /etc/firewall
table 1 add 10.1.1.34/32 2
table 1 add 10.1.1.62/32 2
table 1 add 10.1.1.68/32 2
table 2 add 10.1.1.15/32 5
table 2 add 10.1.1.17/32 6
table 2 add 10.1.1.20/32 6
table 2 add 10.1.1.151/32 6
table 2 add 10.1.1.187/32 6
table 2 add 10.1.1.59/32 2
table 2 add 10.1.1.202/32 2
table 2 add 10.1.1.152/32 2
pipe 2 config bw 164Kbit/s mask dst-ip 0xffffffff queue 60 gred 0.002/10/30/0.1
pipe 5 config bw 820Kbit/s mask dst-ip 0xffffffff queue 60 gred 0.002/10/30/0.1
pipe 6 config bw 82Kbit/s mask dst-ip 0xffffffff queue 60 gred 0.002/10/30/0.1
add 998 setfib 0 ip from table(1) to any in recv vr0
add 999 setfib 1 ip from table(2) to any in recv vr0
add 1000 allow ip from table(1) to any via vr0
add 1001 allow ip from any to table(1) via vr0
add 1005 allow ip from table(2) to any via vr0
add 1006 allow ip from any to table(2) via vr0
add 1040 deny ip from any to any via vr0
nat 1 config if vr1 reset same_ports deny_in
nat 2 config if vr2 reset same_ports deny_in
add 10130 nat 1 tcp from any to any out xmit vr1 limit src-addr 80
add 10131 allow tcp from any to any out xmit vr1
add 10140 nat 1 ip from any to any out xmit vr1
add 10141 allow all from any to any out xmit vr1
add 20130 nat 2 tcp from any to any out xmit vr2 limit src-addr 80
add 20131 allow tcp from any to any out xmit vr2
add 20140 nat 2 ip from any to any out xmit vr2
add 20141 allow all from any to any out xmit vr2
add 20150 nat 1 ip from any to any in recv vr1
add 20151 nat 2 ip from any to any in recv vr2
add 30151 pipe tablearg ip from any to table(1) in recv vr1
add 30152 pipe tablearg ip from any to table(2) in recv vr2
add 30160 allow all from any to any
add 65534 deny all from any to any
Код: Выделить всё
/usr/home/fill/>ipfw pipe show
00002: 164.000 Kbit/s 0 ms 60 sl. 8 queues (64 buckets)
GRED w_q 0.001999 min_th 10 max_th 30 max_p 0.099991
mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
8 ip 0.0.0.0/0 10.1.1.202/0 88215 107553013 0 0 3917
32 ip 0.0.0.0/0 10.1.1.34/0 86571 113214638 9 10821 5282
60 ip 0.0.0.0/0 10.1.1.62/0 20515 22103607 0 0 405
00005: 820.000 Kbit/s 0 ms 60 sl. 1 queues (64 buckets)
GRED w_q 0.001999 min_th 10 max_th 30 max_p 0.099991
mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
13 ip 0.0.0.0/0 10.1.1.15/0 16525 19590520 0 0 0
00006: 82.000 Kbit/s 0 ms 60 sl. 2 queues (64 buckets)
GRED w_q 0.001999 min_th 10 max_th 30 max_p 0.099991
mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
19 ip 0.0.0.0/0 10.1.1.17/0 134673 10849530 0 0 54647
22 ip 0.0.0.0/0 10.1.1.20/0 11605 9266113 0 0 158
/usr/home/fill/>