Linux 7 NIC Bindings
Posted on February 24, 2018
RHEL7 or CentOS 7 under dual NIC bindings
Application environment: In a production environment, in order to improve network fault tolerance or throughput, the general server will take a multi-NIC binding policy (here only the main standby mode).
Test environment: RHEL7.0 (CENTOS7 applicable) real physical machine, 4 network card, bind NIC 1 (ENO1) and network card 3 (ENO3).
There are two ways to configure a team, the first is to use the NMCLI command (recommended), and the second is to add and configure files (you need to be careful manually).
Specific configuration:
Method 1 (recommended)
- To create a group interface:
NMCLI connection Add type TEAM ifname team0 con-name team0 config ' {"runner": {"name": "Activebackup"} ' #activebackup就是指的主 Standby mode
- Configure the Group interface address:
NMCLI Connection Modify Team0 ipv4.addresses "192.168.1.1/24 192.168.1.254″ #配置IP地址, mask, Gateway
NMCLI Connection Modify TEAM0 Ipv4.method manual
- Add port to group interface:
NMCLI connection ADD ifname em1 con-name team0-port1 type Team-slave master Team0 #将网卡em1加入team0
NMCLI connection ADD ifname em2 con-name team0-port3 type Team-slave master Team0 #将网卡em2加入team0
- To restart the network:
Systemctl Restart Network #配置到此结束
Check
Teamdctl Team0 State #较详细查看team端口并显示当前使用的端口
TEAMNL TEAM0 Ports # simply view the joined ports
Authentication
Manually disconnect the current route or use the command IP link set enox down simulation
Detailed testing can be done by opening a long ping on another host and then breaking the link to see the packet loss and connectivity.
End.
For details, please visit the following address: unexpected surprises
Linux Cloud Virtualization Automation
Linux 7 NIC Bindings