I have two docker hosts (VMware virtual machines) connected to one vlan. Gateway is xx.xx.xx.1, first VM has address xx.xx.xx.3 and second xx.xx.xx.4. On each host I create macvlan network:
docker network create -d macvlan --subnet=xx.xx.xx.0/24 --gateway=xx.xx.xx.1 -o parent=ens192 mcv
I cannot ping from host to container and form container to its host, but I can ping two conrainers running on the same host in macvlan network. When I trying to ping the gateway the result is it is unreachable.
Route command inside a container:
Destination Gateway Genmask Flags Metric Ref Use Iface
default xx.xx.xx.1 0.0.0.0 UG 0 0 0 eth0
xx.xx.xx.0 * 255.255.255.0 U 0 0 0 eth0
Expected result:
New containers get IP from my VLAN but they should connect between two hosts and the Internet.
Maybe someone has an idea how fix or do it in different way.
Output of docker version:
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built:
OS/Arch: linux/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built:
I also have the same problem. I tried with and without promiscuous mode (VMware network), but both modes are not working with macvlan driver. Using inside VM vmxnet3.
I have opened a service request at VMware and I was told that’s a docker driver problem.
Was there ever a solution to this? I have the same problem. I also tried exposing ports in the Docker run command line for each container, but that doesn’t work.
The link doesn’t exactly talk about getting host to container communication working. I do have a macvlan interface on the host as well.
What I’m trying to do is have a container appear as a physical machine on the network. I figured what I could do is create a macvlan interface on the host. Spin up my container, and then have the container use this macvlan interface for traffic to the outside world. This is mostly for some experimentation we’re doing.
Yes, the only way for host to talk to containers in macvlan network is to create macvlan interface on the host. The details were in the Q&A section of blog. I have moved that to 1 of the sections in the blog now for easier reference.
Everything seems to work. The only problem I had is the container is not able to connect its own host ip address. It can connect to a remote host but not its own host.
So, I’m in the situation where my containers on the macvlan are pingable from the network, and I can ping machines back. However I can’t seem to ping the gateway.
Any ideas why that would be? I’ve read through Sreenivas’s post but can’t make sense of where I go wrong.
situation: network is 10.0.0.0/16 - host is 10.0.0.2, GW is 10.0.0.1. Gateway can be pinged from the host.