[Bug 1708166] Re: systemd/udev does not rename network interfaces specified in .link files

Dimitri John Ledkov launchpad at surgut.co.uk
Wed Aug 2 15:31:47 UTC 2017


Only the first link file will be applied and the rest will be ignored.

.link files are copied into the initramfs, as udev is started there.

Could you please try:

1) rename eth0.link to 00-eth0.link
2) update initramfs, e.g. $ sudo update-initramfs -u
3) reboot and check if you get expected behaviour.

If you still do not get the names you want, then please attach the
output of:

$ udevadm info -q all -p /sys/class/net/enp2s0

** Changed in: systemd (Ubuntu)
       Status: New => Incomplete

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

Title:
  systemd/udev does not rename network interfaces specified in .link
  files

Status in systemd package in Ubuntu:
  Incomplete

Bug description:
  $ ip link show
  ...
  2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
      link/ether d0:50:99:76:a1:bf brd ff:ff:ff:ff:ff:ff

  $ cat /etc/systemd/network/eth0.link
  [Match]
  MACAddress=d0:50:99:76:a1:bf
  [Link]
  Name=eth0

  I am pretty sure that MAC addresses do match
  And I don't change net.ifnames to 0 :

  $ cat /proc/cmdline
  BOOT_IMAGE=/boot/vmlinuz-4.4.0-87-generic.efi.signed root=/dev/mapper/vg_smart-root_smart ro

  then :

  $ sudo udevadm test-builtin net_setup_link /sys/class/net/enp2s0
  [sudo] password for mwg:
  calling: test-builtin
  === trie on-disk ===
  tool version:          229
  file size:         6841778 bytes
  header size             80 bytes
  strings            1755242 bytes
  nodes              5086456 bytes
  Load module index
  timestamp of '/etc/systemd/network' changed
  Parsed configuration file /etc/systemd/network/eth0.link
  Parsed configuration file /lib/systemd/network/99-default.link
  Created link configuration context.
  ID_NET_DRIVER=r8169
  Config file /lib/systemd/network/99-default.link applies to device enp2s0
  ID_NET_LINK_FILE=/lib/systemd/network/99-default.link
  Unload module index
  Unloaded link configuration context.

  (and, surely, the interface is renamed from eth0 to enp2s0 on boot,
  but not renamed back afterwards)

  can you please tell where I could be wrong ?

  on my existing systems I still keep MAC->ifname relations in
  /etc/udev/rules.d/70-persistent-net.rules inherited from past Ubuntu
  versions. But this is a new setup of Ubuntu 16.04 and I would like to
  configure it in the new & recommended way.

  thanks in advance for your replies

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1708166/+subscriptions



More information about the foundations-bugs mailing list