当使用ping命令时,发现该IP地址不可达。请检查如下:
首先,机器上的路由表route -n
结果样例
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.33.254 0.0.0.0 UG 0 0 0 enp5s0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.33.0 0.0.0.0 255.255.255.0 U 0 0 0 enp5s0
其次,检查机器上的每张网卡的路由信息ip route show
结果样例
default via 192.168.33.254 dev enp5s0 onlink
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.33.0/24 dev enp5s0 proto kernel scope link src 192.168.33.159
最后,在检查一下ARP信息arp -n
结果样例
Address HWtype HWaddress Flags Mask Iface
192.168.33.79 ether e4:3d:1a:f9:5b:70 C enp5s0
192.168.33.77 ether 3c:ec:ef:b4:93:92 C enp5s0
172.17.0.2 ether 02:42:ac:11:00:02 C docker0
192.168.33.71 ether 3c:ec:ef:2d:92:67 C enp5s0
192.168.33.74 ether ec:2a:72:0c:5f:ea C enp5s0
192.168.33.171 ether 00:0c:29:2a:2f:77 C enp5s0
192.168.33.254 ether 6c:e2:d3:01:75:47 C enp5s0
192.168.33.70 ether 3c:ec:ef:2d:0a:ec C enp5s0
192.168.33.75 ether 3c:ec:ef:2d:95:60 C enp5s0