Usually the network card name is automatically recognized by the system and exists in the registry. However, some users want to modify the network card name of the CentOS6.x system for some reason. How do the network card name change? Let's take a look at it with Xiaobian.
CentOS 6.X modify the network card under the name of three ways:
Method 1:
UDEV modify the file, delete the contents inside; command, redefined Name, both names must be changed;
Method 2:
In centos6, you can use setup directly, set up a new network card, fill in eth1, ip and so on.
In CentOS 6, the default kudzu service for identifying hardware does not exist. Basically all hardware management is managed by Udev.
If you add a new hardware to Centos 6, for example, the network card only needs to restart udev.
start_udev
It will rescan the newly added hardware and do related processing.
If the new network card is added, the identification is incorrect and sometimes you want to update the name of the network card, you do not need to edit the contents of /etc/sysconfig/network-scripts/, after running to the above, it is not normal, directly modify Udev can be configured for the network.
The configuration file for the specific NIC serial number of the udev of the network is /etc/udev/rules.d/70-persistent-net.rules.
Probably as follows:
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==“? *”, ATTR{address}==“54:52:00:78:e8:2e”, ATTR{type}==“1”, KERNEL==“eth*”, NAME=“ Eth1” # PCI device
0x1af4:0x1000 (virtio-pci) SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==“? *”, ATTR{address}==“54:52:00:04:19:6c”, ATTR{type}==“1”, KERNEL==“eth*”,
NAME=“eth0”
Refer to the above to modify the MAC address and NAME at most.
After the modification is completed, use the udev command to test:
udevadm test /sys/class/net/eth0/
This command can display the identification of udev in great detail. And the process of processing.
Note:
Newly added hardware, if a network card is added in setup and system-config-network-tui, but /etc/sysconfig/network-scripts/cannot find the configuration file Time.
Because these commands will put the generated configuration file into /etc/sysconfig/networking/devices/by default, just put the following two configuration files in /etc/sysconfig/network-scripts/, and then Use
system-config-network-tui to configure it.
Code Example: cp /etc/sysconfig/networking/devices/* /etc/sysconfig/network-scripts/
Then it will take effect after rebooting.
Method 3:
1. Increase the startup parameter of biosdevname=0 in grub, such as
kernel /vmlinuz-2.6.32-131.21.1.el6. I686 ro root=/dev/mapper/vg_test-lv_root rd_LVM_LV=vg_test/lv_root rd_LVM_LV=vg_test/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latar
cyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us Crashkernel=auto rhgb quiet biosdevname=0
2, delete the udev configuration file rm -f /etc/udev/rules.d/70-persistent-net.rules
3, put the network card Rename the configuration file
mv ifcfg-em1 ifcfg-eth0
4. Correct the contents of the NIC configuration file and change all em1 to eth0
You can use perl -p - i -e ‘s/em1/eth0/g’ ifcfg-eth0 or sed -i ‘s/em1/eth0/g’ ifcfg-eth0 is replaced.
5, restart the system can be
The above is the method of changing the name of the network card CentOS6.x introduced, this article introduced a total of three ways to modify the name of the network card, you can modify the UDEV file, or Then use the setup and other methods to achieve.
If you create a lot of branches when using git under Linux, and then do not need to
Linux system operation, in addition to the use of tool conversion file encoding, bu
Using the ftp command in the Linux system, users can perform file transfer operatio
We all know how to delete system files under Linux, but sometimes it is not complete, how to complet
Linux method for synthesizing multiple file contents
Ubuntu 12.04 installs the method using GNOME 3
Linux system how to create a scheduled task with crontab
Linux steps to use Windows documentation
CentOS open Eclipse error Failed to load the JNI shared how to solve?
Repairing database skills after Linux system crashes
Linux installation of Redis methods and common problems
Learn to use the character set encoding of tool conversion files in Linux systems
/usr/bin/ld in Linux: Can't find -lxxx What should I do?
Learn to use Windows Server 2003 partition capacity enhancement function
Mobile phone Baidu blocking advertising graphic steps teaching
Using the Win 7 file library to collect important files
Re-acquire windows7 system administrator authority
IE10/IE11 can not display Flash how to do
Experience Win8 OneNote High-efficiency and big-featured
When the win7 system opens the txt file, it prompts "Cannot find the script file". How to solve
How to install the .NET Framework 3.5
What should I do if the win2003 system does not recognize the mobile hard disk?