Solve the problem of Nic Port disorder in CentOS7

Source: Internet
Author: User
In the recent project, we encountered a problem that made us unable to solve the problem: DellR920 installed CentOS7 on the system. after Bonding, we found that the port will be disordered after the system is restarted. The process is as follows: in case of Port disorder, two NICs with two 10-Gigabit ports and one with four gigabit ports are configured on the server. The two ports are Bonding on different 10-Gigabit cards, at the same time, two ports of the Gigabit card are selected for Bonding, which is roughly as follows :,

In the recent project, we encountered a problem, which made us unable to solve the problem: the CentOS7 system was installed on Dell R920. after Bonding, we found that the port will be disordered after the system is restarted. The process is as follows:

  1. Port disorder

    Two NICs with two 10-Gigabit ports and one gigabit and four-port NIC are configured on the server. The two ports are used as Bonding for different 10-Gigabit NICs, at the same time, two ports of the Gigabit card are selected for Bonding, which is roughly as follows :,

    Eth0, eth1, eth2, eth3 Gigabit ports, eth4, eth5, eth6, and eth7 are 10 Gigabit ports. in this case, the ports eth3 and eth4 are frequently disordered, and the two ports are changed, the port with bonding failed to take effect.

     

  2. Port naming rules for CentOS7

    Originally, Nic ports before CentOS6 were named after eth, and gigabit network ports after CentOS7 were changed to random em0.0... emN or ens01 (N = integer), the 10 Gigabit network port is in the form of p1p2, and the mode to be modified to eth is as follows:

    A. edit the file

    Vi/etc/sysconfig/grub

    GRUB_TIMEOUT = 5

    GRUB_DISTRIBUTOR = "$ (sed's, release. * $, g'/etc/system-release )"

    GRUB_DEFAULT = saved

    GRUB_DISABLE_SUBMENU = true

    GRUB_TERMINAL_OUTPUT = "console"

    GRUB_CMDLINE_LINUX = "rd. lvm. lv = centos/swap vconsole. font = latarcyrheb-sun16 net. ifnames = 0 biosdevname = 0 rd. lvm. lv = centos/root crashkernel = auto vconsole. keymap = us rhgb quiet"

    GRUB_DISABLE_RECOVERY = "true"

    "The above marked red value is the basis for modifying to eth"

    B. execute the command to take effect

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

    C. add planning documents

    Vi/etc/udev/rules. d/70-persistent-net.rules

     

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 78: 2b: cb: xx: 01 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 78: 2b: cb: xx: 02 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 78: 2b: cb: xx: 03 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth2"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 78: 2b: cb: xx: 04 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth3"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 1b: 21: xx: a1 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth4"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 1b: 21: xx: a0 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth5"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 60: 6e: xx: f6 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth6"

 

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 60: 6e: xx: f7 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth7"

"The above MAC address corresponds to the NIC port"

 

Conclusion: The above method does not solve the problem of network port disorder, because the official documents require that bond's network cards do not need to write MAC addresses, in the end, we try to write HWADDR in each/etc/sysconfig/network-scripts/ifcfg-eth * Nic configuration file, restart it 7-8 times, and perform ethtool checks several times, if no problem is found, you are advised to try this method if you encounter the same problem.

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.