... we have added native support for a number of different naming policies into systemd/
udevd proper and made a scheme similar to biosdevname's (but generally more powerful, and closer to
kernel-internal device identification schemes) the default. The following different naming schemes for network interfaces are now supported by
udev natively:
- Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
- Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
- Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
- Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
- Classic, unpredictable kernel-native ethX naming (example: eth0)
By default, systemd v197 will now name interfaces following policy 1) if that information from the firmware is applicable and available, falling back to 2) if that information from the firmware is applicable and available, falling back to 3) if applicable, falling back to 5) in all other cases. Policy 4) is not used by default, but is available if the user chooses so.
This combined policy is only applied as last resort. That means, if the system has biosdevname installed, it will take precedence. If the user has added udev rules which change the name of the kernel devices these will take precedence too. Also, any distribution specific naming schemes generally take precedence.
Come again, what good does this do?
With this new scheme you now get:
- Stable interface names across reboots
- Stable interface names even when hardware is added or removed, i.e. no re-enumeration takes place (to the level the firmware permits this)
- Stable interface names when kernels or drivers are updated/changed
- Stable interface names even if you have to replace broken ethernet cards by new ones
- The names are automatically determined without user configuration, they just work
- The interface names are fully predictable, i.e. just by looking at lspci you can figure out what the interface is going to be called
- Fully stateless operation, changing the hardware configuration will not result in changes in /etc
- Compatibility with read-only root
- The network interface naming now follows more closely the scheme used for aliasing block device nodes and other device nodes in /dev via symlinks
- Applicability to both x86 and non-x86 machines
- The same on all distributions that adopted systemd/udev
- It's easy to opt out of the scheme (see below)
Does this have any drawbacks? Yes, it does. Previously it was practically guaranteed that hosts equipped with a single ethernet card only had a single "eth0" interface. With this new scheme in place, an administrator now has to check first what the local interface name is before they can invoke commands on it where previously they had a good chance that "eth0" was the right name.
I don't like this, how do I disable this?
You basically have three options:
- You disable the assignment of fixed names, so that the unpredictable kernel names are used again. For this, simply mask udev's .link file for the default policy: ln -s /dev/null /etc/systemd/network/99-default.link
- You create your own manual naming scheme, for example by naming your interfaces "internet0", "dmz0" or "lan0". For that create your own .link files in /etc/systemd/network/, that choose an explicit name or a better naming scheme for one, some, or all of your interfaces. See systemd.link(5) for more information.
- You pass the net.ifnames=0 on the kernel command line