MACvLan problems


I try to setup a server with photon OS.
My goal is to setup the containers with a own static ip address in there own network subnet (public not internal subnet on the machine)

For the Containers I created a subnet with following specs: -
Subnet Mask:

Reserved IPs: - .20
PhotonOS: (inside the network)

So i created a config template:

docker network create

And the network:
docker network create --attachable -d bridge --scope=swarm --config-from docker-network-config docker-network

After that i created a testcontainer with
docker run -it --rm --net=docker-network --ip= alpine /bin/sh

So i test the ip address inside with ip a
it showed the (not my static ip)

A ping from server and from a other host to the container both fails - the ip is not available.

Why that? Can somebody help my? What is wrong?

Afaik, the bridge driver does not establish multi node communication.
You will need the overlay driver to have establish multi node communication.

With macvlan overlay?

docker network create --attachable -d overlay --scope=swarm --config-from docker-network-config docker-network

I tried it now with:
docker network create --attachable -d macvlan --scope=swarm --config-from docker-network-config docker-network

Nothing changed - the promiscuous mode is also enabled in vsphere for the virtual switch.

Even though the thread title includes MACvLan, your initial post does not mention it at all. Whatever you tried, it was not creating a swarm aware macvlan network (though it would explain why you first create a config template and use it to create a final network, which kind of didn’t make sense with bridged network).

If you follow Docker 17.06 Swarm Mode: Now with built-in MacVLAN & Node-Local Networks support - Collabnix, you should be able sort out your problem.

Does the router exist outside of docker?

Yes, I follow it. Sorry i saw my issuse - but with the -d macvlan driver, it dosen’t work too. When i create two containers then i can ping the other container, but not from a other non-docker host. Yes the router exist outside docker.

The network is created in vsphere and the router configured - the docker hosts network adapter is assigned to this network.