At boot time (or whenever a network driver is loaded) interfaces are always assigned ethX style names by the kernel, where X is the lowest currently unused number starting with 0 (zero). The kernel has no ability to ensure drivers or interfaces are presented in the same order every time. Because of this, every time the system boots, it is necessary that some OS function ensures a given interface is always assigned the same name, so renaming of interfaces will be seen during the boot process. In RHEL 7, this OS function is provided by systemd’s Predictable Network Interface feature.

 

Starting RHEL 7, RedHat has introduced Consistent Network Device Naming which ensures network devices are given consistent names across reboots. It is strongly recommended this feature is not disabled. But if you still want the old ethX style of naming for the network interfaces, use the steps given below.

 

Enabling the old eth# style of network interface naming scheme

 

1. To disable Consistent Network Device Naming and the biosdevname naming scheme on RHEL 7/CentOS 7, edit the /etc/default/grub file and append both the net.ifnames=0 and biosdevname=0 parameter values to the file’s GRUB_CMDLINE_LINUX parameter:

# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel_7/swap rd.luks.uuid=luks-cc387312-6da6-469a-8e49-b40cd58ad67a crashkernel=auto  vconsole.keymap=us vconsole.font=latarcyrheb-sun16 rd.lvm.lv=rhel_7/root rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true" 

 

2. Rebuild the /boot/grub2/grub.cfg file by running the grub2-mkconfig command:

# grub2-mkconfig -o /boot/grub2/grub.cfg

 

Note: for systems booted using UEFI:

# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

 

3. Update the interface configurations to prepare for the new device names. First, find the current device name. In the example below, the device name is ‘ens33‘ and the Connection Profile name is ‘Wired‘:

# nmcli connection show
NAME   UUID                                  TYPE            DEVICE 
Wired  63cba8b2-60f7-4317-bc80-949e800a23cb  802-3-ethernet  ens33

 

4. Update the Connection Profile to set the device name to eth0:

# nmcli connection modify Wired connection.interface-name eth0

 

5. Reboot the system:

# shutdown -r now

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)