Step 1: modify the grubvi/boot/grub. conf system and add a biosdevname = 0 startup parameter. The result is as follows: [root @ xingfujitsu ~] # Cat/boot/grub. conf # grub. confgeneratedbyanaconda # Notethatyoudonoth Step 1: modify the grub system
Vi/boot/grub. conf
Add a start parameter with biosdevname = 0. the modification result is as follows:
[Root @ xingfujie ~] # Cat/boot/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