CentOS7 change the NIC name to eth0

Source: Internet
Author: User

CentOS7 change the NIC name to eth0
Preface

Both RHEL 7 and CentOS 7 are used.NetworkManager.serviceFor network management, of coursenetworkThe service can still be used, but it will also be a residue in the transitional period.
In other versionsThe Udev file has been modified fromifcfg-eth0Changedifcfg-eno16777736. In addition, when creating a 7 VM in VMWare, the NIC device is clearly added, but cannot be found in the system. This article mainly records howifcfg-eno16777736Changeifcfg-eth0And the NIC device is added to VMWare.

In CentOS 7, why is Nic named like this?

RHEL7 uses the dmidecode collection naming scheme to obtain the motherboard information.
The NIC name can be permanently unique, And the RHEL6 Nic name will change as needed rather than unique and fixed.
Ethernet: enX (X can be of the following three types)
Wireless Network: wlX
Cable: wwX

  • O motherboard board Nic
  • P independent NIC, PCI Nic
  • S hot swapping Nic, usb and so on

Xxxx (number) indicates that the MAC address + motherboard information is used to calculate a unique sequence.

Use RHEL6 Nic naming rules in RHEL7

If you are not used to the dmidecode collection name of RHEL7, you can modify the configuration to restore it to the RHEL6 naming scheme.
Modify the Grub configuration file
(PASS Parameters to the kernel when the system is started, and disable dmidecode collection on the motherboard)
Vim/etc/sysconfig/grub

# Add net. ifnames = 0 biosdevname = 0 in GRUB \ _ CMDLINE_LINUX configuration item # disable BIOSDEV Configuration

Reload Grub Configuration

grub2-mkconfig -o /boot/grub2/grub.cfg

Generate the RHEL6 Nic configuration file

cd /etc/sysconfig/network-scriptsmv ifcfg-enxxxxxx ifcfg-eth0

Configure Nic vim ifcfg-eth0

NAME="eth0"ONBOOT=yes

Restart the system to take effect

systemctl reboot
Add Nic device for CentOS7 in VMWare

VMWare has a small BUG. When we specify multiple NICs while creating a virtual machine, additional NICS will not be discovered, in this case, we need to remove the undiscovered Nic In the virtual machine settings, and then add a new Nic, VMWare will refresh the VM and then useifconfigA new Nic device appears.ifcfg-eth0Copyifcfg-eth1Then you can use it.Note: When the MAC Address and nic configuration file of the NIC DeviceHDADDRAn LSB error occurs when the configuration file is inconsistent.HDADDR. The real MAC Address of the NIC device.ifconfigTo view

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.