Docker Community Forums

Share and learn in the Docker community.

Ping between containers on different docker host but connected by overlay networ fails


(Sjeeva) #1

Hello All,

I have created a overlay network and launched containers on different node using that overlay network. Though the containers on the other node are able to find the IP address of the container by its host name, it is not reachable…

node1$ sudo docker run -itd --net mynewnet --name host10 ubuntu
25b5496cb3edbe5c0b8f46c810bdd640b9853d5dea05670ef0c8e6d800c55b28

node2$ sudo docker run --net mynewnet ubuntu ping host10 PING host10 (10.0.3.2) 56(84) bytes of data.
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=1 Destination Host Unreachable
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=2 Destination Host Unreachable
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=3 Destination Host Unreachable
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=4 Destination Host Unreachable
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=5 Destination Host Unreachable
From 8cc18cd49ec1 (10.0.3.4) icmp_seq=6 Destination Host Unreachable
^C
— host10 ping statistics —
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8046ms
pipe 3

how do I resolve this issue? Any suggestion on how to debug this issue?

Thanks,
Jeeva


(Jeff Anderson) #2

What were the commands that you used to set up the docker network? What sort of environment are these two machines in? aws? virtualbox? something else?


(Harmish Khambhaita) #3

I have the same issue. I’m trying to make container inside an Ubuntu machine talk to another container running inside Virtualbox (Ubuntu) in Windows 10 machine. The Virtualbox is using NAT networking. Using bridge network for Virtualbox is not an option for me as my infrastructure assigns IP based on MAC address and I cannot add arbitrary MAC address to the system whenever I create a virtual machine. Do I need to special configuration for NAT port-forwarding? Do I need any other configurations?

I also have a third Ubuntu machine connected to same overlay network. The containers inside both Ubuntu machines can talk to each other but they are not able to talk to containers inside the Virtualmacine (and vice versa). However, ‘docker network inspect overlaynetwork’ shows all cotainers (inside Ubuntu machines and Virtualbox) and reports correct ip addresses.

More info:
consul container is running inside one of the Ubuntu machine.
all three docker engines are started with --cluster-store=consul://<ip_of_ubuntu_machine>:8500 --cluster-advertise=eth1:2376 options.
MAC addresses of Ubuntu machine and Windows machine are registered with infrastructure to get IP addresses.

Extra info:
If I use weave, all container can talk to each other. However, weave uses --privileged mode to start containers which are not compatible when user-namespace mappings are enabled (which I need in my case).


(Gerry91) #4

Exactly the same here. I am trying to connect containers running on Linux machines to a container running on OS X. Somehow, the packages do not find their way in or out of the VM managed by docker-machine. The containers are all listed appropriately when running docker network inspect on the overlay network though. Managing the containers with docker-compose works without any problems.