CENTOS7 Network card naming

Source: Internet
Author: User

In the PXE installation test for CENTOS7, it was found that the name of the network card is no longer followed by the naming rules and the latest naming method is enabled, and the official website documents are described below:

In Red Hat Enterprise Linux 7, systemd and UDEVD support a number of different naming schemes. The default behavior is to assign a fixed name based on firmware, topology, and location information. The advantage of this naming method is that it is fully automatic and predictable, even if adding or removing hardware does not change (no re-enumeration) and can replace the damaged hardware without any impact. The disadvantage of this behavior is that the name is sometimes harder to read than the name used earlier, such as replacing eth0 with Enp5s0. CurrentlyThe following naming schemes are supported by UDEVD itself. Scenario 1The name of the merged firmware or BIOS provides the name of the index number for the onboard device, for example: Eno1. If the firmware information is applicable and available, systemd By default, the interface is named according to this scheme, and scenario 2 is used as an alternative. Scenario 2The name of the merged firmware or BIOS provides the name of the PCI hot swappable slot index number, such as ens1. If the firmware information is applicable and available, systemd By default, the interface is named according to this scheme, and scenario 3 is used as an alternative. Scenario 3Merge the name of the physical location of the hardware connector, for example: Enp2s0. If the firmware information is applicable and available, systemd By default, the interface is named according to this scheme, and scenario 5 is used as an alternative. Scenario 4The name of the merge interface MAC address, for example: Enx78e7d1ea46da. By default systemd does not name the interface based on this scheme, but it can be enabled if needed. Scenario 5Traditional non-predictable kernel attributes EthX named, for example: eth0. If all other methods fail, Systemd named interfaces based on this scheme. If the system has biosdevname enabled, or if the user has added a change to the kernel device name UDEVD Rules, these rules override the default systemd policy.


1. The workaround is as follows:

These is the necessary steps:

    • Add "Net.ifnames=0" and "biosdevname=0" as kernel arguments to grub
    • In '/etc/sysconfig/network-scripts/' your configured NIC config file to ' ifcfg-ethx '
    • If you have multiple interfaces and want to control naming of each device rather than letting the kernel does in its own ,/etc/udev/rules.d/60-net.rules seems necessary to override/usr/lib/udev/rules.d/60-net.rules.
    • Citation: http://wiki.centos.org/FAQ/CentOS7

2. Because the CENTOS7 uses GRUB2 guidance, it is also necessary to modify the GRUB2 as follows:
Vim/etc/defaut/grub added "Net.ifnames=0 biosdevname=0"
Grub2-mkconfig-o/boot/grub2/grub.cfg

CENTOS7 Network card naming

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.