When using Linux/centos 7 o'clock it may be found that the default NIC name is a random number after installing the system, the use of the process is extremely inconvenient to use, Linux/centos 7 of this change is due to the introduction of new network card naming technology in SYSTEMD and Udev, The device name can be renamed after the old hardware has been broken, but the initial generated device name is random, and the system will be named Em1 when the early CentOS 6 is out of the system without the biosdevname=0 parameter. With the subsequent compatibility of continuous well after the name of the NIC is still more familiar with the eth0 such, but in the CentOS 7 system only add the biosdevname=0 parameters do not work, but also need to make some changes, the operation is very simple, as follows:
[Email protected] ~]# Cd/etc/sysconfig/network-scripts/[[email protected] network-scripts]# mv Ifcfg-ens33 Ifcfg-eth0 [[email protected] network-scripts]# sed-i ' s/ens33/eth0/g ' ifcfg-eth0# modify NIC name [[email protected] network-scripts]# VIM/ Etc/sysconfig/grubgrub_timeout=5grub_distributor= "$ (SED ' s, release. *$,,g '/etc/system-release)" grub_default= savedgrub_disable_submenu=truegrub_terminal_output= "Console" grub_cmdline_linux= "Crashkernel=auto RHGB Net.ifnames=0 biosdevname=0 quiet "#在这里添加" net.ifnames=0 biosdevname=0 "2 parameters grub_disable_recovery=" true "[email Protected] sysconfig]# Grub2-mkconfig-o/boot/grub2/grub.cfg
If there is no ifconfig tool can be installed with yum-y install Net-tools, after the above modifications to restart the system, the system's default NIC name is changed to the default eth0
This article from "Jim's Technical Essay" blog, reproduced please contact the author!
Modify the default NIC name under Linux/centos 7