使用FreeBSD构建流量控制防火墙( 二 )


允许TCP到主机192.168.250.0/24的所有其他连接,限制流量为1Mbit/s
禁止其他所有连接
--------------------------------------------------------------------------------
实例
# ipfw -flush
# ipfw add 100 pipe 1 icmp from any to any
# ipfw pipe 1 config bw 10Kbit/s
# ipfw add 200 pipe 2 udp from any to any
# ipfw pipe 2 config bw 100Kbit/s
# ipfw add 300 pipe 3 tcp from 192.168.254.0/24 to any
# ipfw pipe 3 config bw 5Mbit/s
# ipfw add 400 pipe 4 tcp from any to 192.168.254.0/24
# ipfw pipe 4 config bw 5Mbit/s
# ipfw add 500 pipe 5 tcp from any to 192.168.250.222 80
# ipfw pipe 5 config bw 2Mbit/s
# ipfw add 600 pipe 6 tcp from 192.168.250.222 80 to any
# ipfw pipe 6 config bw 2Mbit/s
# ipfw add 700 pipe 7 tcp from 192.168.250.0/24 to any
# ipfw pipe 7 config bw 1Mbit/s
# ipfw add 800 pipe 8 tcp from any to 192.168.250.0/24
# ipfw pipe 8 config bw 1Mbit/s
# ipfw add 60000 deny ip from any to any
【使用FreeBSD构建流量控制防火墙】# ipfw -a l

推荐阅读