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

6
  • Why is the address already in use? Mar 6, 2021 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 6, 2021 at 19:17
  • Well, trhat's why it isn't working. Mar 6, 2021 at 19:19
  • What do you mean ?
    – Ulrar
    Mar 6, 2021 at 19:26
  • You specified an IP address that already exists, when it is expecting a network that does not already exist. Mar 6, 2021 at 19:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.