Problem:
After installing the Linux operating system, some Dell servers find that the nic name has changed to em1.
Solution:
Change the nic name to eth0. The CentOS Operating system is used as an example.
1. Modify the grub system
Vi/boot/grub. conf # Add biosdevname = 0 to the kernel parameter
Kernel/vmlinuz-2.6.32-573.7.1.el6.x86_64 ro root =/dev/mapper/VolGroup-lv_root kernel LANG = en_US.UTF-8 rd_NO_MD kernel = VolGroup/lv_swap SYSFONT = latarcyrheb-sun16 crashkernel = auto kernel = VolGroup/lv_root KEYBOARDTYPE = pc KEYTABLE = us rd_NO_DM biosdevname = 0 rhgb quiet
2. Modify the Nic naming rule configuration file of udev
Vi/etc/udev/rules. d/70-persistent-net.rules # Modify
This server has four NICs. The identified NICs are: em1, em2, em3, and em4 (the em code starts from 1 and does not have em0 ),
Modify em1 to eth0, em2 to eth1, em3 to eth2, and em4 to eth3.
3. Modify the name of the current Nic configuration file
Cd/etc/sysconfig/network-scripts/# enter the Nic configuration file directory
Mv ifcfg-em1 ifcfg-eth0 # Rename
Mv ifcfg-em2 ifcfg-eth1
Mv ifcfg-em3 ifcfg-eth2
Mv ifcfg-em4 ifcfg-eth3
4. Modify the content of the NIC configuration file and change em to eth.
Cd/etc/sysconfig/network-scripts/# enter the Nic configuration file directory
Vi ifcfg-eth0 # modify em1 inside to eth0
Vi ifcfg-eth1 # modify em2 inside to eth1
Vi ifcfg-eth2 # modify em3 inside to eth2
Vi ifcfg-eth3 # modify em4 inside to eth3
: Wq! # Save and exit after modification
5. Restart the system to make the above changes take effect.
Shutdown-r now # Restart