1
:在配置网卡的时候,要记住
eth0
里面可以加入
gateway
,而
eth1
里面不能加入自己的
gateway
。
2
:在网卡配置完成后,开始对路由表的设置:
Ip route add 192.168.4.0/24 via 192.168.2.1
下面见表:
①、
vi /etc/iproute2/rt_tables
添加
252 tel
(电信线路路由表)
251 cnc
(网通线路路由表)
②、设置
tel
和
cnc
路由表的内容
ip route flush table tel
ip route add default via 192.168.1.1 dev eth0 src 192.168.1.2 table tel
ip rule add from 192.168.1.2 table tel
ip route flush table cnc
ip route add default via 192.168.2.1 dev eth1 src 192.168.2.2 table cnc
ip rule add from 192.168.2.2 table cnc
然后就
OK
了。可以试试,
telnet
两个公网
IP
,呵呵
转载于:https://blog.51cto.com/ashly/993118