Docker Community Forums

Share and learn in the Docker community.

Connect to static public IP, which resolves to local container

docker

(Christian Hotz-Behofsits) #1

Hi, I have the following problem: I started a container and attached a port (e.g., 80) to an static and “public” ip that is linked to that machine (e.g., docker run -p 123.4.5.6:80:80). When I open the IP from outside (other network and other machine) it works fine! But when I want to connect to this ip from a container in the same network it does not work. For example starting a new container on the same machine and calling telnet 123.4.5.6 80 returns the following error:

telnet: Unable to connect to remote host: No route to host


(Sam) #2

what is the new container network? where is the gateway for 123.4.5.6?

what is ‘linked to that machine’, you mean docker host, what is the docker host ip address?