Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Windows host accesses docker container ip cannot communicate with ping

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Windows host accesses docker container ip cannot communicate with ping

Container IP

Ping Container IP

C:\ WINDOWS\ system32 > ping 172.17.0.2 is Ping 172.17.0.2 with 32 bytes of data: request timed out. Request timed out. Request timed out. Request timed out. 172.17.0.2 Ping statistics: packet: sent = 4, received = 0, loss = 4 (100% lost), troubleshooting reason:

Firewalls

At first, I always thought that there was something wrong with the firewall. I tried the container's firewall, but it couldn't operate at all, because there was no permission, and the host firewall was turned off, and the fault was still the same.

Routin

Many people on the Internet said that it was a routing problem, so they began to check the train of thought to see if the route from the host to the container was blocked, so a route was added.

Route add 172.17.0.0 mask 255.255.0.0. 172.17.0.1, no.

Route add 172.17.0.0 mask 255.255.0.0 192.168.0.149 host IP149 does not work

Looked at a docker setting.

The bridge of docker. The gateway is 10.0.75.1. Try adding this route.

C:\ WINDOWS\ system32 > route add 172.17.0.0 16 mask 255.255.255.0 10.0.75.2-p

Operation complete!

Test ping 172.17.0.2

C:\ WINDOWS\ system32 > ping 172.17.0.2

Ping 172.17.0.2 has 32 bytes of data:

Reply from 172.17.0.2: bytes = 32 time

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report