Here is an explanation of how SystemD predictable network interface names are determined.
Predictable network interface device names are based on:
– firmware/bios-provided index numbers for on-board devices
– firmware-provided pci-express hotplug slot index number
– physical/geographical location of the hardware
– the interface’s MAC address
Two character prefixes based on the type of interface:
1 2 3 4 |
en -- ethernet sl -- serial line IP (slip) wl -- wlan ww -- wwan |
Type of names:
1 2 3 4 5 6 7 8 9 |
b<number> -- BCMA bus core number ccw<name> -- CCW bus group name o<index> -- on-board device index number s<slot>[f<function>][d<dev_port>] -- hotplug slot index number x<MAC> -- MAC address [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>] -- PCI geographical location [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>] -- USB port number chain |
All multi-function PCI devices will carry the [f
When using PCI geography the PCI domain is only prepended when it is not 0.
For USB devices the full chain of port numbers of hubs is composed. If the name gets longer than the maximum number of 15 characters the name is not exported.
The usual USB configuration == 1 and interface == 0 values are suppressed.
PCI ethernet card with firmware index “1”:
1 2 |
ID_NET_NAME_ONBOARD=eno1 ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1 |
PCI ethernet card in hotplug slot with firmware index number:
1 2 3 4 |
/sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1 ID_NET_NAME_MAC=enx000000000466 ID_NET_NAME_PATH=enp5s0 ID_NET_NAME_SLOT=ens1 |
PCI ethernet multi-function card with 2 ports:
1 2 3 4 5 6 |
/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0 ID_NET_NAME_MAC=enx78e7d1ea46da ID_NET_NAME_PATH=enp2s0f0 /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1 ID_NET_NAME_MAC=enx78e7d1ea46dc ID_NET_NAME_PATH=enp2s0f1 |
PCI wlan card:
1 2 3 |
/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0 ID_NET_NAME_MAC=wlx0024d7e31130 ID_NET_NAME_PATH=wlp3s0 |
USB built-in 3G modem:
1 2 3 |
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6 ID_NET_NAME_MAC=wwx028037ec0200 ID_NET_NAME_PATH=wwp0s29u1u4i6 |
USB Android phone:
1 2 3 |
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2 ID_NET_NAME_MAC=enxd626b3450fb5 ID_NET_NAME_PATH=enp0s29u1u2 |
How to turn it off
There are 4 ways to turn it off and get back your old trusted network interface names (like ethX etc.):
Boot the kernel with net.ifnames=0 (might also need biosdevname=0)
Disable the assignment of fixed names so that the unpredictable kernel names are used again by masking udev’s rule file for the default policy:
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
(since v209: this file was called 80-net-name-slot.rules in release v197 through v208)
Use your own manual naming scheme (e.g. “internet0”, “dmz0” or “lan0”) by creating your own udev rules file and set the NAME property for the devices. Make sure to order it before the default policy file, for example by naming it
/etc/udev/rules.d/70-my-net-names.rules
Alter the default policy file for picking a different naming scheme for example for naming all interface names after their MAC address by default:
cp /usr/lib/udev/rules.d/80-net-setup-link.rules /etc/udev/rules.d/80-net-setup-link.rules
Then edit the file there and change the lines as necessary.
More information here.