配置双网卡,电信联通通外网。配置路由。

配置双网卡,电信联通通外网。配置路由。 前提第二张网卡不能添加网关,不然重启network 就起不来了。


echo "250  CTC" >> /etc/iproute2/rt_tables  ##电信路由表

echo "251  CNC" >> /etc/iproute2/rt_tables  ##联通路由表

echo "251  CM" >> /etc/iproute2/rt_tables    ##移动路由表


echo "ip route add default via 183.131.23.129(电信网关) table CTC" >> /etc/rc.d/rc.local

echo "ip rule add from 115.231.103.68(电信IP) lookup CTC" >> /etc/rc.d/rc.local


echo "ip route add default via 101.71.29.65 (联通网关)table CNC" >> /etc/rc.d/rc.local

echo "ip rule add from 101.71.29.69(联通IP) lookup CNC" >> /etc/rc.d/rc.local


echo "ip route add default via 101.71.29.65 (移动网关)table CNC" >> /etc/rc.d/rc.local

echo "ip rule add from 101.71.29.69(移动IP) lookup CNC" >> /etc/rc.d/rc.local


你先加到rc.local


ip route add default via 183.131.23.129 table CTC  

ip rule add from 183.131.23.134 lookup CTC              (电信ip)



ip route add default via 223.95.78.65 table CMCC

ip rule add from 223.95.78.91 lookup CMCC                (移动ip) 



你可能感兴趣的:(NetWork,default,路由表,电信网,策略路由,电信联通)