为什么能Ping通另一台宿主机上容器的网关,但是ping不通容器?
三台宿主机上的容器IP段分别为: 172.16.0.1 , 172.17.0.1 ,172.27.0.1
17 和 27网段互相只能ping通对方的网关ip,但是ping不通容器ip ;
但是17 和 27 网段却都能ping 通16网段的容器ip
从宿主机1的容器内部:
[root@ct001 /]# ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.
64 bytes from 172.17.0.1: icmp_seq=1 ttl=63 time=0.309 ms
64 bytes from 172.17.0.1: icmp_seq=2 ttl=63 time=0.264 ms
...
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.239/0.281/0.309/0.033 ms
ping 网关能通
[root@ct001 /]#
[root@ct001 /]#
[root@ct001 /]# ping 172.17.0.3
PING 172.17.0.3 (172.17.0.3) 56(84) bytes of data.
--- 172.17.0.3 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms
ping容器ip不通
贴一下宿主机1上的路由表:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.11.1 0.0.0.0 UG 100 0 0 enp8s0f1
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
172.17.0.0 192.168.11.6 255.255.0.0 UG 2 0 0 enp8s0f1
172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker_gwbridge
172.27.0.0 192.168.11.5 255.255.0.0 UG 2 0 0 enp8s0f1
192.168.11.0 0.0.0.0 255.255.255.0 U 100 0 0 enp8s0f1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
宿主机和容器内都没有开启防火墙服务
宿主机:
[root@zj002 docker]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
有朋友知道是什么原因导致现在这种情况吗?