Linux serverNETWORK ADMINISTRATIONS

Change NIC Name in CENTOS 7

In CentOS 7 the naming convention for network interfaces is automatically determined based on firmware, topology, and location information can result in a long interface names. Having a network interface in a long name doesn’t satisfy the people.

Edit file /etc/default/grub in line starting with GRUB_CMDLINE_LINUX and append “net.ifnames=0 biosdevname=0” at the end of the line as the following.

#vim /etc/default/grub

GRUB_CMDLINE_LINUX=”crashkernel=auto rd.lvm.lv=vg-systems/lv-root rd.lvm.lv=vg-systems/lv-swap rd.lvm.lv=vg-systems/lv-usr rhgb quiet net.ifnames=0 biosdevname=0″
Execute command grub2-mkconfig as the following to create a new configuration based on the currently running system.

#grub2-mkconfig -o /boot/grub2/grub.cfg

Then again, rename the interface file ifcfg-eno16777728 in directory /etc/sysconfig/network-scripts to ifcfg-eth0 as the following.

#mv /etc/sysconfig/network-scripts/ifcfg-eno16777728 /etc/sysconfig/network-scripts/ifcfg-eth0

Then, we need to edit file /etc/sysconfig/network-scripts/ifcfg-eth0 and change the NAME and DEVICE from “eno16777728” to “eth0” as the following.

# vim /etc/sysconfig/network-scripts/i

Finally, reboot the server and verify the new interface name as below.

# reboot

Check the NIC Name with command,
# ip add

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *