Add support for creating MACVLAN interfaces with "Add Interface"

You need to create a docker network, with something like this

docker network create -d macvlan -o parent=ens3 --subnet 192.168.0.0/24 --gateway 192.168.0.254 --ip-range 192.168.0.40/29 macvlan0

In that network create, I reserve the subnet 192.168.0.40/29 for docker. Docker will then hand addresses out from that subnet to containers.

Then if you want the docker containers and host to be able to communicate with each other you need to route between the two. This has to be done using a post-init script, something like this:

# creagte a mvlan0 interface
ip link add mvlan0 link ens3 type macvlan mode bridge
ip link set mvlan0 up

# add a route to the macvlan subnet via the mvlan0 interface
ip route add 192.168.0.40/29 dev mvlan0

That will route the subnet 192.168.0.40/29 into the macvlan that mvlan0 is a member of.

If you want to specify a specific IP address to route, use /32 to define the “subnet”

The simple alternative would be to create the MACVLAN interface in the GUI… hence this feature request :wink: