I have a host (Ubuntu), a docker container (centOS), a virtual machine (centOS).
- My Host has 2 interfaces, one is eth0 "", one is docker0 ""
- My docker container have IP "". It has a service bind on port 80.
- On Virtual Machine, I use bridge adapter with docker0 and I config "/etc/sysconfig/network-scripts/ifcfg-eth0" file like this:


From host, I telnet to container's service

$ telnet 80
Connected to
Escape character is '^]'.

It is OK!
BUT, From Virtual Machine I cannot telnet to it

$ telnet 80
telnet: Unable to connect to remote host: Connection timed out

From my Virtual Machine, I can ping the Docker Container

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.091 ms

So, How to telnet to my service on Docker Container?

  • I flushed all iptables' rule. But I cannot telnet. – mahi Sep 25 '15 at 2:20
  • Have you checked with netstat to see if there is something listening on that port? (netstat -an) – Rob Sep 25 '15 at 2:51
  • @Rob: on my Docker Container, there is only my service on port 80. – mahi Sep 25 '15 at 6:48
  • When a docker container is start, my host create a virtual interface called vethXXXX (eg: vethf345a6e). I used vethXXXX for bridge adapter of my VM. And everything is OK, the problem is resolved! BUT I don't understand about that. – mahi Sep 28 '15 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.