Friday 30 July 2021

How to Change Network Interface Name from enp1s0f1 to eth0 on RedHat 8.1 Linux Server


This tutorial will guide you on how to perform a Network Interface Name change from ifcfg-enp1s0f1 to eth0 on RedHat 8.1 Linux server.

Execute below command to list all the network devices

[root@worldwidelinux ]# nmcli device

nmcli

Please follow below steps to change a network interface name on RedHat 8.1 Linux Server:

1. Update GRUB File

Edit file /etc/default/grub and add net.iframes=0 blosdevname=0 to line GRUB_CMDLINE_LINUX.

GRUB File

2. Regenerate a GRUB configuration file and overwrite existing one:

[root@worldwidelinux ]# grub2-mkconfig -o /boot/grub2/grub.cfg

GRUB File

3. Edit NAME, DEVICE and HWADDR paarameters in ifcfg-enp1s0f1 file.

Change NAME, DEVICE and HWADDR fields from enp1s0f1 to eth0 on ifcfg-enp1s0f1 file.

Network Script File

4. Move ifcfg-enp1s0f1 file to ifcfg-eth0

Move a network configuration file to ifcfg-eth0 using mv command.

[root@worldwidelinux ]# mv /etc/sysconfig/network-scripts/ifcfg-enp1s0f1 /etc/sysconfig/network-scripts/ifcfg-eth0

Move

5. Disable Network Manager Service

For network interface name change, you must disable networkmanager service otherwise it will revert back the changes on reboot.

Disable Network Manager

6. Reboot a server

You can manually reboot server by pressing power button or execute a reboot command in terminal.

[root@worldwidelinux ]# reboot

Reboot

7. Check Network Interface Name

Execute nmcli command to list all the network devices.

[root@worldwidelinux ]# nmcli device

Network Interface Name