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.

To Change the NetWork Interface Name to Match CentOS 6 Conventions

  1. Log in to the server at the command line as root, either via SSH or from the terminal

  2. Using a text editor, open /etc/default/grub

    vim /etc/default/grub
    
  3. 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"
      
  4. Save the change and exit the file

  5. Run the following to test the configuration:

    grub2-mkconfig**
    
  6. If there are no errors apply the change:

    grub2-mkconfig -o /boot/grub2/grub.cfg
    
  7. 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
    
  8. With a text editor, open the network configuration file

    vim ifcfg-eth0
    
  9. In edit mode, edit the DEVICE variable to reflect the new name

    DEVICE="eth0"
    
  10. Save the change and exit the file

  11. Reboot, or restart networking

service network restart