Failure to create macvlan: failed to allocate gateway (192.168.1.1): Address already in use

Host: Docker for windows (Windows 10 Pro)
Physical router: 192.168.1.1
Local network 192.168.1.x, subnet 255.255.255.0

Container needs:

  1. Open port to the world. (Running plex server)
  2. To be able to connect to siblings of host machine. (Mounting shared folders)

Been struggling for hours to create a macvlan.

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth0 mynet

Returns:

Error response from daemon: failed to allocate gateway (192.168.1.1): Address already in use

I’ve changed settings in Hyper-V Manager to allow mac address spoofing.

I’ve read as much as I can from the documentation. It’s 4 am and I can’t see straight. In case gateway wasn’t referring to my physical gateway, I tried to give it another IP, but that ended up with a disconnected container. Tried using a different ip-range, but won’t allow using gateways outside it.

I also tried figuring out if eth0 is actully the name of my NIC on windows, but I have no idea. Honestly I think that might be it. I have no idea what else it can be.

Can someone please point me in the right direction?

welcome to the fun, the docker design doesn’t expect the container to have its own NORMAL network address.

you can solve this by mapping the containers plex port onto the docker host and then accessing the docker host from remotes…

This was really strange. I got random --mount bind errors to a host windows folder. I fiddled back and forth with all kinds of settings in Docker, Hyper-V and the container.

Now I rebooted and suddenly everything works with Bridge mode. I also changed the method of mounting host windows folder from mount to volume. I’ve spent about 8 hours over two days fiddling with this and to have it suddenly work with settings I’ve tried multiple times is just… frustrating and relieving at the same time. I’m writing this up as docker for windows instability.