ip link add macvlan0 link eth0 type macvlan mode bridge
----
$ cat /etc/netplan/docker.yaml
network:
version: 2
renderer: networkd
ethernets:
macvlan0: addresses:
- 192.168.1.6/32
routes:
- to: 192.168.1.2/31 via: 192.168.1.6 metric: 100
- to: 192.168.1.4/31 via: 192.168.1.6 metric: 100
----
Set the script to be executable "chmod o+x,g+x,u+x /etc/networkd-dispatcher/routable.d/10-macvlan-interfaces.sh"
----
Apply the changes:
netplan apply
Building on #18
I got the whole process working using netplan. For anyone needing a little more details
$ cat /etc/networkd- dispatcher/ routable. d/10-macvlan- interfaces. sh
#! /bin/bash
ip link add macvlan0 link eth0 type macvlan mode bridge docker. yaml
addresses:
via: 192.168.1.6
metric: 100
via: 192.168.1.6
metric: 100 dispatcher/ routable. d/10-macvlan- interfaces. sh"
----
$ cat /etc/netplan/
network:
version: 2
renderer: networkd
ethernets:
macvlan0:
- 192.168.1.6/32
routes:
- to: 192.168.1.2/31
- to: 192.168.1.4/31
----
Set the script to be executable "chmod o+x,g+x,u+x /etc/networkd-
----
Apply the changes:
netplan apply