CentOS “Destination Host Unreachable”问题解决办法

挑战极速安装CentOS时遇到局域网主机不能通信的情况:

[root@zjd network-scripts]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=40 time=28.0 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=40 time=26.3 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=40 time=24.1 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 3 received, 50% packet loss, time 5001ms
rtt min/avg/max/mdev = 24.167/26.179/28.007/1.573 ms
[root@zjd network-scripts]# ping 10.0.100.245
PING 10.0.100.245 (10.0.100.245) 56(84) bytes of data.
From 10.0.10.23 icmp_seq=1 Destination Host Unreachable
From 10.0.10.23 icmp_seq=2 Destination Host Unreachable
From 10.0.10.23 icmp_seq=3 Destination Host Unreachable

查看路由表:

[root@zjd network-scripts]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    0      0        0 enp2s0
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 enp2s0
link-local      0.0.0.0         255.255.0.0     U     1002   0        0 enp2s0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
[root@zjd network-scripts]# route del -net 10.0.0.0 netmask 255.0.0.0

可以看出第二、三条路由有问题,删除即可。

总结:

网上很多解决方法是关闭NetworkManager,添加网卡物理地址到网卡配置文件。其实通信不正常,直接看看路由怎样走,删除不正确的路线就可以了。

挑战极速安装CentOS时遇到局域网主机不能通信的情况: [root@zjd network-scripts]# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=40 time=28.0 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=40 time=26.3 ms 64 bytes from 8.8.8.8: icmp_seq=6 ttl=40 time=24.1 ms ^C --- 8.8.8.8 ping statistics --- 6 packets transmitted, 3 received, 50% packet loss, time 5001ms rtt min/avg/max/mdev = 24.167/26.179/28.007/1.573 ms [root@zjd network-scripts]# ping 10.0.100.245 PING 10.0.100.245 (10.0.100.245) 56(84) bytes of data. From 10.0.10.23 icmp_seq=1 Destination Host Unreachable From 10.0.10.23 icmp_seq=2 Destination Host Unreachable From 10.0.10.23 icmp_seq=3 Destination Host Unreachable 查看路由表: [root@zjd network-scripts]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default gateway 0.0.0.0 UG 0 0 0 enp2s0 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 enp2s0 link-local 0.0.0.0 255.255.0.0 U 1002 0 0 enp2s0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 [root@zjd network-scripts]# route del -net 10.0.0.0 netmask 255.0.0.0 可以看出第二、三条路由有问题,删除即可。 总结: 网上很多解决方法是关闭NetworkManager,添加网卡物理地址到网卡配置文件。其实通信不正常,直接看看路由怎样走,删除不正确的路线就可以了。
经验分享 程序员 微信小程序 职场和发展