- 论坛徽章:
- 0
|
下面这个是网上参考别人的思路来的,给IP包打了标记,IP包出去的时候根据原先打的标记判断IP包的出口是那个:
##anchors
ext_if1 = "rl0" //接网通
ext_if2 = "rl1" //接电信
ext_gw1 = "218.104.232.1" //网通网关
ext_gw2 = "61.154.11.254" //电信网关
loop = "lo0"
service = "{22, 80, 443}"
scrub in all
antispoof for {$ext_if1, $ext_if2} inet
##default deny
block all
block return
##general "pass in" rules for external and loop interfaces
pass quick on $loop all
pass in on $ext_if1 tag cncgroup keep state
pass in on $ext_if2 tag chinanet keep state
##general "pass out" rules for external interfaces
pass out on {$ext_if1, $ext_if2} proto tcp from any to any flags S/SA modulate state
pass out on {$ext_if1, $ext_if2} proto { udp, icmp } from any to any keep state
##route packets from any IPs on $ext_if1 to $ext_gw1 and the same for
##$ext_if2 and $ext_gw2
pass out quick on $ext_if1 route-to ($ext_if2 $ext_gw2) tagged chinanet keep state
pass out quick on $ext_if2 route-to ($ext_if1 $ext_gw1) tagged cncgroup keep state
希望有条件的测试一下 |
|