1, the host can ping gateway 172.17.0.1, but ping different containers, such as: 172.17.0.2
Can ping between 2, containers, but you can't ping gateway 172.17.0.1
3, IP forwarding has opened, the cat/proc/sys/net/ipv4/ip_forward shows the 1
4, the use of bridge model and port mapping, such as the -p 80:80,
Telnet 172.17.0.2 shows 80
Telnet: Unable to connect to remote host: No route to host
Telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
The Escape character is' ^].
Connection closed by foreign host.
Consult everybody a great god and see what could be the cause?
CodePudding user response:
The iptablesroot @ BPI: ~ # iptables - L - n
Chain INPUT (policy ACCEPT)
Target prot opt source destination
Chain FORWARD policy (DROP)
Target prot opt source destination
DOCKER - USER all -- 0.0.0.0/0 0.0.0.0/0
DOCKER - ISOLATION - all stages - 1-0.0.0.0/0 0.0.0.0/0
ACCEPT all - 0.0.0.0/0 0.0.0.0/0 ctstate RELATED, ESTABLISHED
DOCKER all - 0.0.0.0/0 0.0.0.0/0
ACCEPT all - 0.0.0.0/0 0.0.0.0/0
ACCEPT all - 0.0.0.0/0 0.0.0.0/0
Chain the OUTPUT (the policy ACCEPT)
Target prot opt source destination
Chain DOCKER references (1)
Target prot opt source destination
ACCEPT the TCP - 0.0.0.0/0 172.17.0.2 TCP DPT: 80
Chain DOCKER references (1) - the ISOLATION - STAGE - 1
Target prot opt source destination
DOCKER - ISOLATION - STAGE - 2 all -- 0.0.0.0/0 0.0.0.0/0
RETURN all - 0.0.0.0/0 0.0.0.0/0
Chain DOCKER - ISOLATION - STAGE - 2 references (1)
Target prot opt source destination
DROP all - 0.0.0.0/0 0.0.0.0/0
RETURN all - 0.0.0.0/0 0.0.0.0/0
Chain DOCKER - USER references (1)
Target prot opt source destination
RETURN all - 0.0.0.0/0 0.0.0.0/0
CodePudding user response:
Shut down the firewall and selinux,Docker, if not specified, the network will be the default specified on docker0, so create out of the container should be on the same network segment,
https://blog.csdn.net/heian_99/article/details/104914945
You can consider this,
CodePudding user response:
The route - n may be a routing problem, a host computer, cut a figure a look