laventy
(Laventy)
August 1, 2020, 6:53am
1
Hey guys,
I am struggling with this issue for hours and can’t figure it out.
So I have two containers (say named as container-A and container-B) in the same bridge network in the same host.
Then in container-A (by docker exec -it container-A bash), run:
curl container-B
it returns me:
curl: (7) Failed to connect to container-B port 80: No route to host.
Why is that? it seems the containers in the same network cannot communicate with each other.
For more info:
if I run curl container-B-IP in the docker host, then it can return me something I want.
laventy
(Laventy)
August 1, 2020, 7:28am
2
Solved by running only the first command only in this post:
docker
Hello @laventy ,
This has already been well expalined in below post!
Basically it’s because of firewall restricting your route communications.
i would highly recommend you to go through below post,
Last comment here. I found the problem and the solution.
Problem: Centos 8 firewall
Best Solution: add the docker networks/interfaces to a trusted zone.
In the host:
1: Find the network interfaces used by docker - run the command:
nmcli
and will show all network interfaces in the computer. The docker interfaces are: docker0 and br-xxxxxxxx (i think that depends on how many networks you have in the cluster)
For me, was 3 networks.
2- Add all interfaces to trusted zone with the command:
…
Hi @laventy ,
This solution adds more security risks on your docker!
Better to configure only the networks that are created by docker as explained in the below post,
Last comment here. I found the problem and the solution.
Problem: Centos 8 firewall
Best Solution: add the docker networks/interfaces to a trusted zone.
In the host:
1: Find the network interfaces used by docker - run the command:
nmcli
and will show all network interfaces in the computer. The docker interfaces are: docker0 and br-xxxxxxxx (i think that depends on how many networks you have in the cluster)
For me, was 3 networks.
2- Add all interfaces to trusted zone with the command:
…