route -n
60.xxx.xxx.92 0.0.0.0 255.255.255.252 U 0 0 0 eth1 (联通)
222.xxx.240.0 0.0.0.0 255.255.255.248 U 0 0 0 eth2 (网通)
0.0.0.0 60.xxx.xxx.93 0.0.0.0 UG 0 0 0 eth1
我从本机上ping 网通网关
PING 60.xxx.xxx.93 (60.xxx.xxx.93) 56(84) bytes of data.
64 bytes from 60.xxx.xxx.93: icmp_seq=1 ttl=255 time=2.45 ms
64 bytes from 60.xxx.xxx.93: icmp_seq=2 ttl=255 time=1.46 ms
64 bytes from 60.xxx.xxx.93: icmp_seq=3 ttl=255 time=2.20 ms
ping电信网关
PING 222.xxx.240.1 (222.xxx.240.1) 56(84) bytes of data.
64 bytes from 222.xxx.240.1: icmp_seq=1 ttl=244 time=139 ms
64 bytes from 222.xxx.240.1: icmp_seq=2 ttl=244 time=137 ms
64 bytes from 222.xxx.240.1: icmp_seq=3 ttl=244 time=137 ms
64 bytes from 222.xxx.240.1: icmp_seq=4 ttl=244 time=137 ms
单设一个电信IP正常,把default gw 设为电信IP正常
后来我做了如下操作
ip route flush table tel
ip route add default via 222.xxx.240.1 dev eth2 src 222.xxx.240.4 table tel
ip rule add from 222.xxx.240.4 table tel
ip route flush table cnc
ip route add default via 60.xxx.xxx.93 dev eth1 src 60.xxx.xxx.94 table cnc
ip rule add from 60.xxx.xxx.94 table cnc
主要问题是现在ping电信网关延迟太大,
ping电信网关
PING 222.xxx.240.1 (222.xxx.240.1) 56(84) bytes of data.
64 bytes from 222.xxx.240.1: icmp_seq=1 ttl=244 time=139 ms
64 bytes from 222.xxx.240.1: icmp_seq=2 ttl=244 time=137 ms
64 bytes from 222.xxx.240.1: icmp_seq=3 ttl=244 time=137 ms
64 bytes from 222.xxx.240.1: icmp_seq=4 ttl=244 time=137 ms