Score:0

Migrate from ifupdown to netplan

br flag

I try to migrate from ifupdown to netplan, but the result is always not same.

What is the correct netplan configuration for networking configuration like this:

auto lo
iface lo inet loopback

auto eno0
iface eno0 inet static
  address xxx.xxx.51.20/24
  gateway xxx.xxx.51.254 
  post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  post-up echo 1 > /proc/sys/net/ipv4/conf/eno0/proxy_arp


auto vmbr0
iface vmbr0 inet static
  address xxx.xxx.198.104/24
  bridge-ports none
  bridge-stp off
  bridge-fd 0


auto vmbr1
iface vmbr1 inet static
  address xxx.xxx.198.105/24
  bridge-ports none
  bridge-stp off
  bridge-fd 0

auto vmbr2
iface vmbr2 inet static
  address xxx.xxx.198.106/24
  bridge-ports none
  bridge-stp off
  bridge-fd 0

auto vmbr3
iface vmbr3 inet static
  address xxx.xxx.198.107/24
  bridge-ports none
  bridge-stp off
  bridge-fd 0
Score:0
br flag

After a few days of trials and errors, I found out that at the moment, [netplan doesn't support macvlan bridge yet][5], we need a workaround and alter systemd network:

  • We need to create a few files on /etc/systemd/network, so navigate to the directory:
$ cd /etc/systemd/network
  • Define vlans for the bridge, please change cat to your editor
$ cat 00-vmvlan0.netdev 
[NetDev]
Name=vmvlan0
Kind=macvlan
# Optional MAC address, or other options
MACAddress=xx:xx:xx:xx:26:12

[MACVLAN]
Mode=bridge

$ cat 00-vmvlan0.network 
[Match]
Name=vmvlan0

[Network]
Address=xxx.xxx.198.104/32
IPForward=yes
ConfigureWithoutCarrier=yes
  • Define Bridge
$ cat 00-vmbr0.netdev 
[NetDev]
Name=vmbr0
Kind=bridge

$ cat 00-vmbr0.network 
[Match]
Name=vmbr0

[Network]
MACVLAN=vmvlan0

  • repeat for the next IPs
  • Link bridge, vlan, and interface:
$ cat 10-netplan-eno1.link 
[Match]
MACAddress=xx:xx:xx:xx:19:d0

[Link]
Name=eno1
WakeOnLan=off

$ cat 10-netplan-eno1.network 
[Match]
MACAddress=xx:xx:xx:xx:19:d0
Name=eno1

[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6
MACVLAN=vmvlan0
MACVLAN=vmvlan1
MACVLAN=vmvlan2
MACVLAN=vmvlan3

[DHCP]
RouteMetric=100
UseMTU=true


  • and we can use default netplan configuration:
$ sudo cat /etc/netplan/50-cloud-init.yaml
network:
    version: 2
    ethernets:
        eno1:
            dhcp4: true
            match:
                macaddress: xx:xx:xx:2a:19:d0
            set-name: eno1
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.