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