0

I have one simple server with a bunch of docker containers running on an ipvlan network, which uses 172.22.0.0/16 as it's net. In there is a gateway and everything is working great.

I need to run one container in a different vlan, so I created an interface called "vlan41" on my host and I'm trying to create a second ipvlan network on it :

# docker network  create  -d ipvlan --subnet=172.19.41.0/24 --gateway=172.19.41.254 --ip-range=172.19.41.16/28 -o ipvlan_mode=l2 -o parent=vlan41 mynet
Error response from daemon: failed to allocate gateway (172.19.41.254): Address already in use

I've tried everything I could think of, I cannot make it work. I thought it might be a poor error message caused by the fact that the vlan is sharing the same raw device as the existing ipvlan network, but changing the mac address of the vlan doesn't seem to solve it.

Any way to make this work ? Thanks

Ulrar
  • 367
  • 4
  • 22
  • Why is the address already in use? – Michael Hampton Mar 06 '21 at 18:41
  • Well it's the gateway IP but strangely changing the gateway doesn't seem to do solve this, it really has something against that IP specifically. As far as I can the only place this address is used is in the host's routing table for the vlan41 interface, nowhere else (ip route add default via `172.19.41.254` table vlan41 && ip rule from `172.19.41.1` table vlan41) – Ulrar Mar 06 '21 at 19:17
  • Well, trhat's why it isn't working. – Michael Hampton Mar 06 '21 at 19:19
  • What do you mean ? – Ulrar Mar 06 '21 at 19:26
  • You specified an IP address that already exists, when it is expecting a network that does not already exist. – Michael Hampton Mar 06 '21 at 19:57
  • You mean the gateway should not exist ? How would that ever work ? My other ipvlan network is using an existing gateway and that is working fine. The gateway is not on the host, it's an actual physical router – Ulrar Mar 06 '21 at 20:31

0 Answers0