CentOS 7 has introduced a new naming convention for network interfaces that can result in long interface names. Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. Modern server platforms with multiple network adapters can encounter non-deterministic and counter-intuitive naming of these interfaces. This affects both network adapters embedded on the motherboard (Lan-on-Motherboard, or LOM) and add-in (single and multiport) adapters.
In CENTOS 7 Linux, udev supports a number of different naming schemes. The default is to assign fixed names based on firmware, topology, and location information. This has the advantage that the names are fully automatic, fully predictable, that they stay fixed even if hardware is added or removed (no re-enumeration takes place), and that broken hardware can be replaced seamlessly. The disadvantage is that they are sometimes harder to read than the eth0 or wlan0 names traditionally used. For example: enp5s0. Refer to the solution section for resolution.
Topic
- How to enable the old style ethX network interface names on Centos|Fedora|RHEL?
- Old style network interface names ethX
apt
- Centos
- RHEL
- Scientific Linux
- Fedora
Solution
In order to disable dynamic Network Device Naming and the biosdevname
naming scheme on RHEL 7/CentOS 7, append net.ifnames=0
and biosdevname=0
parameter in /etc/default/grub
file in the GRUB_CMDLINE_LINUX
line.
- Edit the
/etc/default/grub
file and in theGRUB_CMDLINE_LINUX
section appendnet.ifnames=0
andbiosdevname=0
. Cofiguration should look like below:
$ cat /etc/default/grub
[...]
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root00 rd.lvm.lv=rhel/swap biosdevname=0 net.ifnames=0 rhgb quiet"
[...]
- Rebuild the
/boot/grub2/grub.cfg
file with the following command.
# grub2-mkconfig -o /boot/grub2/grub.cfg
Note: for systems booted using UEFI:
# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
- Reboot the system and after reboot, you will see old style ethernet(ethx) devices will appear instead of
ENPX
orenpx
ethernet device.