How to change the NIC name to eth0 in the newly installed CentOS 7 system

Source: Internet
Author: User
Tags naming convention

From the CENTOS/RHEL7, the predictable naming convention becomes the default. This rule, the interface name is automatically based on the firmware, topology and location information to determine. Now, even if you add or remove a network device, the interface name remains fixed without having to be enumerated, and the broken hardware can be replaced seamlessly.

But this, while beneficial, has affected many users ' operations, because the new naming scheme interface name is a bit harder to read than traditional eth0. For some reasons, such as habit, you want to change the name of the network card, here is a description of how to name the CentOS7 or RHEL7 interface.


1, the system installation is complete, may your network card name is such.

2, first, edit the network card configuration file vi/etc/sysconfig/network-scripts/ifcfg-eno16777736 The inside of the name of the change to eth0

3. Continue, rename the configuration file.

4, and 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 end of the grubcmdlinelinux variable.

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

6, in fact, to the 5th step, the restart in the Ifconfig view should have been effective, according to the CentOS official Wiki FAQ, if you have more than one interface, and want to control its device name, rather than let the kernel in its own way named, create ,/etc/udev/ Rules.d/xxx-net.rules rules are necessary . So here's a good rule to create.

Note: The net rule name for the previous system is 70-persistent-net.rules, where I also define the rule by this name.

7, reboot the system, verify.

Note: If the CENTOS7 system minimal mode installation is not ifconfig command, you can install Net-tools solution.

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.