Ever wondering why the traditional network interface naming such as eth0 is renamed as ens33 nowadays?
This is known as Predictable Network Interface naming and is part of systemd/udev, since v197.
In the past, UNIX naming scheme probe for hardware occurs in no particular order and may change between reboots. Ever since systemd v197, the interface name depens on the physical location of hardware and can be predicted/guessed by looking at lspci or lshw output. This can have serious security implications, for example in firewall rules which are coded for certain naming schemes, and which are hence very sensitive to unpredictable changing names.
- 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) and subsequently 3) 4) 5).
Network interface device naming hierarchy
When consistent device naming is enabled (default), the udev
device manager generates device names based on the following schemes:
Scheme | Description | Example |
---|---|---|
1 |
Device names incorporate firmware or BIOS-provided index numbers
for onboard devices. If this information is not available or
applicable, |
|
2 |
Device names incorporate firmware or BIOS-provided PCI Express
(PCIe) hot plug slot index numbers. If this information is not available
or applicable, |
|
3 |
Device names incorporate the physical location of the connector
of the hardware. If this information is not available or applicable, |
|
4 | Device names incorporate the MAC address. Red Hat Enterprise Linux does not use this scheme by default, but administrators can optionally use it. |
|
5 |
The traditional unpredictable kernel naming scheme. If |
|
To disable "Predictable Network Interface Names" (Ubuntu):
- Edit your /etc/default/grub changing the line from
GRUB_CMDLINE_LINUX=""
to
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
- and, finally update and reboot your system:
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
$ sudo update-grub && sudo reboot
Links: