I actually like predictable interface names I just want to know them before rebooting after a Debian dist-upgrade so that I can change the
/etc/network/interfaces accordingly. Any idea how to predict them?
Note: when you upgrade a Debian system that originally used old-style names, it will keep using old-style names by default: the upgrade process will place a symlink to /dev/null as
/etc/systemd/network/99-default.link which will override the new naming policy file
/lib/systemd/network/99-default.link. If you choose to use the new style, just
rm /etc/systemd/network/99-default.link before rebooting after the upgrade.
If the new version of
udev ruleset is already in place (as you indicated: after
apt dist-upgrade but before rebooting), then
udevadm info -q all -p /sys/class/net/<current name of interface> |grep ID_NET_NAME
should display all the naming options, in the order of descending priority:
enoNwill appear if there is DMI information identifying the network interface as an on-board integrated NIC. By default, this name takes priority over all other options.
- if the NIC is in a PCIe hot-plug slot, you may see a ID_NET_NAME_SLOT
ensNnumber identifying the corresponding slot number
enpNsMcorresponds to PCI device id N:M.0. Unfortunately the device name numbers are in decimal, while PCI device IDs use hexadecimal, so some conversion may be in order.
- if a NIC has multiple ports that appear as separate PCI functions (PCI id N:M.L), then ID_NET_NAME_PATH will be
- there is also the ID_NET_NAME_MAC
enx<MAC address in hex>format. This is not used by default, but might be convenient on USB-connected NICs.
If you don't have even run the upgrade yet, then the procedure would be:
- first, run
dmidecode -t10. If it reports any Ethernet interfaces, they will be listed as onboard ones (
- if you have NICs in hot-plug capable PCIe slots, your hardware manual will hopefully identify the slot numbering.
ethtool -i ethN | grep bus-infoto see the PCI bus identifier of a NIC. Convert the bus ID numbers from hex to decimal and you'll know the
enp...form of the new names. For example:
will map to enp0s25, and a dual-port NIC with
will map to
If you want to tweak the default naming, you can do it with
.link files in
/etc/systemd/network/ directory: see
man systemd.link for details. For example, if you want to use the
enx<MAC> style naming for USB network interfaces, you can add file
/etc/systemd/network/81-usbnet.link with the following contents:
[Match] Path=*usb* [Link] NamePolicy=database mac