Docker Community Forums

Share and learn in the Docker community.

How do i Ping docker container outside a host?


(Asalve) #1

I have setup advance networking on docker container and created bridge network to use specific ip like 172.24.xxx.xxx/28 which is my local LAN ip for docker0.But when i start the container , container gets different range ip address rather than the range which i defined to use with docker0 like 172.24.0.3/28.

I can ping 8.8.8.8 and all my internal ip address from container but when i try to ping container ip from another host i get Request time out.

Can anyone faces this issue?Please let me know how to resolve this issue and get ping response of container outside from host .
I followed below article to setup advance networking on docker,
https://docs.docker.com/articles/networking/


(Servermeta) #2

these are 2 local subnets. There is no path between them. You have to create a route, and I can guess from you post, that it is a task above your skills.

You either create a route in the router, or manually add it to both your hosts.

Or, in a much simpler way, assign a public ip to the given container.


(Andy Rothfusz) #3

You may be able to solve the problem a lot more simply (without any “advanced” networking) by using docker run -p or docker run -P. Those can give you ports on the host that let you reach your container from other machines on your network. http://docs.docker.com/reference/run/#expose-incoming-ports