源地址策略路由

$ cat /etc/iproute2/rt_tables

reserved values

255 local
254 main
253 default
0 unspec

local

1 inr.ruhep

251 unicom
252 telecom

$ cat /etc/rc.local

tel/cnc

.......
ip rule add from 202.104.102.128/25 table telecom
ip rule add from 123.58.55.128/25 table unicom

$ cat /etc/init.d/network
..................
ip route flush table telecom
ip route add default via 202.104.102.129 dev eth1 table telecom
ip route flush table unicom
ip route add default via 123.58.55.129 dev eth1 table unicom
exit $rc

你可能感兴趣的:(源地址策略路由)