Step 1: Modify the grub System
VI/boot/GRUB/grub. conf
Add a start parameter with biosdevname = 0. The Modification result is as follows:
[Root @ xingfujie ~] # Cat/boot/GRUB/grub. conf
# Grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# Notice: you do not have a/boot partition. This means that
# All kernel and initrd paths are relative to/, eg.
# Root (hd0, 0)
# Kernel/boot/vmlinuz-version Ro root =/dev/sda1
# Initrd/boot/initrd-[generic-] version. img
# Boot =/dev/SDA
Default = 0
Timeout = 5
Splashimage = (hd0, 0)/boot/GRUB/splash.xpm.gz
Hiddenmenu
Title centos (2.6.32-220. el6.x86 _ 64)
Root (hd0, 0)
Kernel/boot/vmlinuz-2.6.32-220.el6.x86_64 Ro root = UUID = export rd_no_luks export lang = en_US.UTF-8 rd_no_md quiet sysfont = latarcyrheb-sun16 rhgb crashkernel = auto keyboardtype = pc keytable = US rd_no_dm biosdevname = 0 # ---> here newly Added
Initrd/boot/initramfs-2.6.32-220.el6.x86_64.img
Step 2: Delete the udev configuration file Rm-F/etc/udev/rules. d/70-persistent-net.rules
Note:The second step does not require any operation.
Step 3: Modify the name of the current Nic configuration file
MV ifcfg-em1 ifcfg-eth0
MV ifcfg-em2 ifcfg-eth1
MV ifcfg-em3 ifcfg-eth2
MV ifcfg-em4 ifcfg-eth3
Step 4: Modify the NIC configuration file and change Em1 to eth0.
[Root @ xingfujie ~] # Cat/etc/sysconfig/network-scripts/ifcfg-eth0
Device = "eth0"
Bootproto = "DHCP"
Hwaddr = "24: B6: FD: F8: D5: 84"
Nm_controlled = "yes"
Onboot = "yes"
You can use the following command to replace it:
Perl-p-I-e's/Em1/eth0/G' ifcfg-eth0 or sed-I's/Em1/eth0/G' ifcfg-eth0
Last step: restart the system shutdown-R now after you start, you will find that the familiar eth0-eth4 has come back, by the way, there is another problem with centos 6.2: if you do not write DNS in the NIC configuration file, you will find/etc/resolv after restart. the conf file is cleared. One method is to write DNS in the NIC configuration file, and the other is to give/etc/resolv. conf and I attributes, chattr + I/etc/resolv. conf