VMware Communities
holzhey
Contributor
Contributor

Can not ping Docker Container (in VMWARE WORKSTATION 16 PRO) from HOST (UBUNTU 18.04)

Hello Community Member
I Can not ping Docker Container (in VMWARE WORKSTATION 16 PRO) from HOST (UBUNTU 18.04). both in same machine.

from the HOST IP ROUTE ADD is already done and i can ping the subnet and the route. But the containers i am not able to ping.

> sudo ip route add 192.168.70.0/24 via 172.20.1.47dev enp0s31f6

In VM also i have done

> sudo sysctl net.ipv4.conf.all.forwarding=1

> sudo iptables -P FORWARD ACCEPT

I am able to ping the bridge 192.168.70.129 (interface between HOST and VM) but not able to ping the conatiners inside the VM  (192.168.7.132).

Any advises please

 

Thanks

Labels (2)
0 Kudos
1 Reply
bluefirestorm
Champion
Champion

I am a noob with regards to Docker/containers. My exposure has been a few hours of course videos and labs on Google Cloud with GKE.

From what I understand conceptually the whole point of k8s/dockers, is the convenience of not having to manage the containers (and by extension their IP addresses). Pinging the containers in essence is like managing the containers. The external environment that makes use of the containers should not try to be bound to a particular IP as there is no guarantee it will always be the same (pods can be shut down and brought up by the control plane).

Assuming I am wrong with the paragraph above; and that there is a use-case for pinging/managing the containers; should not this be more of a docker issue rather a Workstation Pro issue? On GKE, one would use the kubectl command so presumably with Docker you would use the docker command.

 

0 Kudos