Rhel7/centos 7 Change the NIC name to Eth0

Source: Internet
Author: User

====== problem =====

Rhel's network card is enoxxxxxxxxx

===== cause ======

From Centos/rhel7, the predictable naming convention becomes the default. This rule, interface names are automatically determined based on firmware, topology, and location information. Now, even if you add or remove network devices, the interface names remain fixed without re-enumeration, and the broken hardware can be replaced seamlessly.

======== Solution ======

1, the system installation is complete, the name of the network card changed to:

2, first of all, first edit the network card configuration file vi/etc/sysconfig/network-scripts/ifcfg-enoxxxxxx to Ifcfg-eth0 and change the name inside to Eth0

3. Then, disable the predictable naming rule. For this, you can pass the kernel parameters of "net.ifnames=0 biosdevname=0" at startup. This is done by editing the/etc/default/grub and adding "net.ifnames=0 biosdevname=0" to the Grubcmdlinelinux variable.

4 Run the command grub2-mkconfig-o/boot/grub2/grub.cfg to regenerate the grub configuration and update the kernel parameters

5 Rebooting the system

=========================

Note: According to the FAQ on the official CentOS wiki, if you have multiple interfaces and want to control their device name, instead of having the kernel name it in its own way, create a /etc/udev/rules.d/xxx-net.rules rule is necessary ! So here we also create a good rule, the previous system's net rule name is 70-persistent-net.rules.

File content rules such as:

If/etc/udev/rules.d/70-persistent-net.rules is removed after reboot not found/etc/udev/rules.d/70-persistent-net.rules use Start_udev rebuild

====== viewing network card UUID----

Nmcli Con

Rhel7/centos 7 Change the NIC name 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.