阿里云 经典网络使用ClassicLink连接到专用网络后,192.168网段需要添加路由

配置后,专用网络中的机器Ping不通经典网络,

查帮助说192.168网段需要手动添加路由表。

抓包能在经典网络中收到专用网络中过来的数据包,但回复的数据包不能正确发出去。

先用 route -n 查看当前路由,

10.0.0.0        10.116.207.247  255.0.0.0       UG    0      0        0 eth0
10.116.200.0    0.0.0.0         255.255.248.0   U     0      0        0 eth0
100.64.0.0      10.116.207.247  255.192.0.0     UG    0      0        0 eth0
172.16.0.0      10.116.207.247  255.240.0.0     UG    0      0        0 eth0

根据示例添加一条

route add -net 192.168.0.0/16 gw 10.116.207.247

再用 route -n 查看

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        10.116.207.247  255.0.0.0       UG    0      0        0 eth0
10.116.200.0    0.0.0.0         255.255.248.0   U     0      0        0 eth0
100.64.0.0      10.116.207.247  255.192.0.0     UG    0      0        0 eth0
172.16.0.0      10.116.207.247  255.240.0.0     UG    0      0        0 eth0
192.168.0.0     10.116.207.247  255.255.0.0     UG    0      0        0 eth0

然后专用网络中的机器就可以Ping通经典网络中的机器了。

原文地址:https://www.cnblogs.com/aozima/p/7522379.html