Hi,

This works on reboot but not so well after the system boots.

Say I have the following file:

network:
    version: 2
    ethernets:
        ens7:
            dhcp4: true
            match:
                macaddress: 52:54:00:b4:02:6e
            set-name: myif1
            optional: true

If I reboot, everything is fine:

ubuntu@netplan2:~$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:d2:9b:b5 brd ff:ff:ff:ff:ff:ff
3: myif1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:b4:02:6e brd ff:ff:ff:ff:ff:ff


But if I now change set-name to myif0, I can't get it to change the name 'live'.

If I apply with the interface 'up', nothing happens, which is fine:

ubuntu@netplan2:~$ sudo netplan apply
ubuntu@netplan2:~$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:d2:9b:b5 brd ff:ff:ff:ff:ff:ff
3: myif1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:b4:02:6e brd ff:ff:ff:ff:ff:ff

But if I bring it down and run netplan apply, the interface is renamed
to ens7, not myif0, and it stays down.

ubuntu@netplan2:~$ sudo ip l set dev myif1 down
ubuntu@netplan2:~$ sudo netplan apply
ubuntu@netplan2:~$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:d2:9b:b5 brd ff:ff:ff:ff:ff:ff
3: ens7: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT 
group default qlen 1000
    link/ether 52:54:00:b4:02:6e brd ff:ff:ff:ff:ff:ff

If I downgrade to 0.36.3, the interface is correctly renamed and brought
up:

9: myif0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:b4:02:6e brd ff:ff:ff:ff:ff:ff

So not an unqualified success here.

Regards,
Daniel

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1770082

Title:
  systemd-networkd not renaming devices on boot

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1770082/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to