Centos Nic name change _ How to change CentOS system Nic name em1 to eth0?

Source: Internet
Author: User
From CentOSRHEL7, the foreseeable naming rules have changed to default. In this rule, the interface name is automatically determined based on the firmware, topology, and location information. Now, even if you add or remove a network device, the interface name remains fixed without reenumeration, and can be replaced seamlessly with the broken hardware.

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

: Wq! # Save and exit

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.

: Wq! # Save and exit

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

So far, the CentOS system has completed modifying the network card em1 to eth0.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.