How to modify the network card em1 to eth0 in CentOS

Source: Internet
Author: User
Tags centos

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

: 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

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.