I think everyone noticed that in Linux 7 network interface name has been changed from eth[0,1..] to ens. But in some organization they what to use eth as a standard network interface name. In this article we will explain how to can change the network interface name.
First we need to edit grub configuration file to append some parameters.
# vim /etc/default/grub
Locate the line “GRUB_CMDLINE_LINUX=” and append the following parameter :
For Eq: GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
Rebuilt Grub Configuration:
After implementing the changes in grub configuration file we need to rebuilt the grub configuration file so the changes will reflect.
# grub2-mkconfig -o /boot/grub2/grub.cfg
Copy or move the network configuration file from ens to eth and change the
Device and Name parameter in network file. # mv /etc/sysconfig/network-scripts/ifcfg-ens /etc/sysconfig/network-scripts/ifcfg-eth0
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
Change the following values from the old to the new interface name :
After completing all the above steps reboot the server to reflect the changes.