Revision history [back]

click to hide/show revision 1
initial version

Renaming network interface name in Centos 7 requires different tasks respect to Centos 6.X

Here there is the tasks that I tested few minutes ago: ( in my example i rename the interface with mac address 00:0c:29:35:7e:1a to eth2)

  • Edit /etc/sysconfig/grub and add net.ifnames=0 biosdevname=0 in the variable GRUB_CMDLINE_LINUX
  • Execute grub2-mkconfig -o /boot/grub2/grub.cfg
  • Reboot
  • Create the file /etc/udev/rules.d/70-persistent-net.rules and add the following line SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="00:0c:29:35:7e:1a", ATTR{type}=="1", KERNEL=="eth", NAME="eth2"
  • Reboot
  • Rename network configuration file ifcfg-* in /etc/sysconfig/network-scripts to ifcfg-eth2
  • Edit the file /etc/sysconfig/network-scripts and rename the device name with eth2
  • Reboot