How to: Change a Network Interface Name on CentOS 7¶
CentOS 7 introduced a new naming convention for network interfaces that can result in long interface names.
InterWorx appends :iw{n} to the interface name when an IP address is added through InterWorx. As network interface names are limited to 16 characters in CentOS, if the interface name exceeds 16 characters, the name is automatically truncate. This may conflict with existing interface names, and has the potential to cause networking issues.
Contents
To Change the NetWork Interface Name to Match CentOS 6 Conventions¶
Log in to the server at the command line as root, either via SSH or from the terminal
Using a text editor, open
/etc/default/grub
vim /etc/default/grub
In edit mode, add the following to the end of the
GRUB_CMDLINE_LINUX
variable:net.ifnames=0 biosdevname=0
The line will look like this:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0"
Save the change and exit the file
Run the following to test the configuration:
grub2-mkconfig**
If there are no errors apply the change:
grub2-mkconfig -o /boot/grub2/grub.cfg
Copy the existing network configuration file to the new interface name
Example, changing eno16777984 to eth0:
cd /etc/sysconfig/network-scripts cp ifcfg-eno16777984 ifcfg-eth0
With a text editor, open the network configuration file
vim ifcfg-eth0
In edit mode, edit the
DEVICE
variable to reflect the new nameDEVICE="eth0"
Save the change and exit the file
Reboot, or restart networking
service network restart