libnetwork: macvlan / ipvlan parent interface (e.g. en0 instead of eth0) broken on Mac OSX
It appears the docker macvlan / ipvlan drivers expect parent (host) interfaces to follow linux-like interface naming (e.g. eth0 as a prefix) and break when faced w/ Mac OSX interface naming (e.g. en0)
When trying to set up a macvlan on Mac OSX w/ the primary network interface en0 as so:
docker network create -d macvlan --subnet=172.16.86.0/24 --gateway=172.16.86.1 -o parent=en0 pub_net
The attempt fails with:
Error response from daemon: invalid subinterface vlan name en0, example formatting is eth0.10 see https://github.com/moby/libnetwork/blob/d0951081b35fa4216fc4f0064bf065beeb55a74b/drivers/macvlan/macvlan_setup.go#L110
When trying to set up a 802.1q trunk macvlan as so:
docker network create -d macvlan --subnet=172.16.86.0/24 --gateway=172.16.86.1 -o parent=en0.86 pub_net_86
The attempt fails with:
Error response from daemon: -o parent interface does was not found on the host: en0 see https://github.com/moby/libnetwork/blob/d0951081b35fa4216fc4f0064bf065beeb55a74b/drivers/macvlan/macvlan_setup.go#L155
The same commands execute without complaint when eth0 instead of en0 is used, but since eth0 doesn’t actually exist on the host, the containers are isolated from the network.
This issue was raised in https://github.com/docker/for-mac/issues/3926 but probably didn’t get any visibility there. Hopefully it’ll get noticed here.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 12
- Comments: 31 (1 by maintainers)
While this repo is in a semi-archived state (only used by the Moby 20.10 branch), I am going to close this issue before the official archiving as it seems to be misleading people. libnetwork does not work natively on macOS; and the “issue” here is that because the networking code runs inside the Linux virtual machine of Docker Desktop, “native” networking modes like
--net=host,ipvlan, andmacvlando not interoperate with the Darwin kernel like you expect.I’d suggested interested users consult https://github.com/docker/roadmap/issues/238 and the many issues linked to it (e.g. for macvlan).
Seems like this issue was 1st reported all the ways back in 2019 perhaps? (but was never looked at)
https://github.com/docker/for-mac/issues/3447
However this bug seems significant! I would recommend at least some look at it, if not should be considered looking towards critical / important / higher priority. Along those lines