Hell, believe or not, I had read along man system.link several times, but I 
would wish to be able to understand all these little subtleties.
"All link files are collectively sorted and processed in lexical order, 
regardless of the directories in which they live. However, files with identical 
filenames replace each other. Files in /etc have the highest priority, files in 
/run take precedence over files with the same name in /usr/lib."
Go figure...

There are plenty of recipes on the Internet telling the reader to disable the 
damned "novelty"
https://askubuntu.com/questions/767786/changing-network-interfaces-name-ubuntu-16-04
https://serverfault.com/questions/837454/interface-will-not-rename-under-systemd
etc
https://www.google.com.ua/search?q=ubuntu+systemd+link+rename+interfaces

Most often, what is forgotten, is regeneration of initramfs file after .link 
changes
But also, sometimes numeric prefix of the .link file name is forgotten as well
So, this is not working, frustrating, infuriating the user and making him want 
to disable the damned thing altogether.

As for me, just now, I managed to guess that .links preventing renaming of VLAN 
interfaces should have earlier prefixes than ones binding known interface names 
to their MAC addresses (as VLAN iface has the same MAC)
This was a really hard-earned knowledge because there are no usable HOWTOs 
about these "novelties"
https://askubuntu.com/questions/791149/prevent-vlan-and-bridge-interface-rename-to-renamex-form
https://www.prolixium.com/blog?id=1023
https://www.google.com.ua/search?q=ubuntu+systemd+vlan+link+rename

So, with current system documentation, unless you don't have an existing
working sample for copying, you are doomed to guessworks, spitting and
cursing until you guess what to write where and how to name it.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, 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:
  Invalid

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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to