connect:Network is unreachable的解决方法
首先确认一点,基本上述错误。不是来自于网络,而是直接来自于服务器本身的问题。
1.查看Linux服务器的路由配置
[root@arpcg network-scripts]# ping 172.30.28.249
connect: Network is unreachable
[root@arpcg network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.30.29.0 * 255.255.255.0 U 1 0 0 eth0
发现没有任何网关的配置,通过配置网关。保证网路畅通。
2.配置网关路由
[root@arpcg network-scripts]# route add default gw 172.30.29.249
[root@arpcg network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.30.29.0 * 255.255.255.0 U 1 0 0 eth0
default 172.30.29.249 0.0.0.0 UG 0 0 0 eth0
3.测试网络连通性
[root@arpcg network-scripts]# ping 172.30.28.249
PING 172.30.28.249 (172.30.28.249) 56(84) bytes of data.
64 bytes from 172.30.28.249: icmp_seq=1 ttl=253 time=4.13 ms
64 bytes from 172.30.28.249: icmp_seq=2 ttl=253 time=5.23 ms
64 bytes from 172.30.28.249: icmp_seq=3 ttl=253 time=4.58 ms
64 bytes from 172.30.28.249: icmp_seq=4 ttl=253 time=4.87 ms