windows host access docker container can not ping ip

windows host access docker container can not ping ip

IP container

windows host access docker container can not ping ip

IP ping container

C:\WINDOWS\system32>ping 172.17.0.2

正在 Ping 172.17.0.2 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。

172.17.0.2的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),

Investigation and the reasons:

  1. Firewall

    Firewall beginning has been that there is a problem, tried firewall container, simply can not operate because there is no authority, off the host firewall, the fault persists

  2. routing

    Many say that the Internet routing problem, start thinking about the investigation, is not host to a container route blocked, then add a route

    route add 172.17.0.0 mask 255.255.0.0. 172.17.0.1 not

    route add 172.17.0.0 mask 255.255.0.0 192.168.0.149 host IP149 not

    Saw a docker settings

windows host access docker container can not ping ip

windows host access docker container can not ping ip

docker bridge, the gateway is 10.0.75.1 try to add this route

C: \ WINDOWS \ system32> route add 172.17.0.0/16 mask 255.255.255.0 10.0.75.2 -p
operation is completed!

Test ping 172.17.0.2

C:\WINDOWS\system32>ping 172.17.0.2

Is the Ping 172.17.0.2 having 32 bytes of data:
Reply from 172.17.0.2: Byte = 32 time <1ms TTL = 63
from the reply 172.17.0.2: bytes = 32 time <1ms TTL = 63
from 172.17.0.2 reply: bytes = 32 time <1ms TTL = 63
from 172.17.0.2 reply: bytes = 32 time <1ms TTL = 63

Ping statistics of 172.17.0.2:
Packet: Sent = 4, received 4 = loss = 0 (0% loss),
the estimated round trip time (in milliseconds):
Minimum = 0ms, the longest = 0ms , average = 0ms

C:\WINDOWS\system32>

Guess you like

Origin blog.51cto.com/zhongliang/2454181