No, this ain't a duplicate of Why doesn't my Wi-Fi adapter show up as wlan0 in 16.04?, as this explains how to restore eth0
naming, but not how to individually name a specific interface.
I don't want to assign based on MAC match. All I need is to assign name based on the USB path.
When I plug in an USB network adapter, on Ubuntu 17.04 it gets assigned a network interface name based on its MAC, such as encx000000000000
. Now I would like to rename it to something more telling, based on its ID_PATH=pci-000:02:03.0-usb-0:1:1.0
. In particular, I don't want to match based on MAC address.
The rationale is that after interface replacement all would break down, but if someone simply replaces network interface hardware so that the new hardware is in the same place as the old one, the system will tuck on without needing IT and reconfiguration support.
So I created a file /etc/systemd/network/50-my-island.link
:
[Match]
Path=pci-000:02:03.0-usb-0:1:1.0
[Link]
Name=island0
Unfortunately, the name is never assigned. Using udevadm info
I can see that there is ID_NET_NAME=island0
set, but it does not apply. Trying NamePolicy=
or NamePolicy=name
under the [Link]
section doesn't help either.
I'm lost! How can I assign my name in the .link file to my USB network adapter? Is this possible at all without resorting to some udev rule? Why then having .link files at all when they don't seem to work in my case? Where did I make an error?
sudo touch /dev/null /etc/udev/rules.d/80-net-setup-link.rules
now causes the USB network interface to becomeeth0
. Slightly better, but still wrong! – TheDiveO Aug 18 '17 at 15:25