May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

RedHat7.3 under the network card Teaming binding

For servers, it is a common requirement to bind multiple network cards (link aggregation). Linux supports bonding in earlier versions of the kernel. It can connect multiple Ethernet interfaces to the network through bonding Up, on the one hand can provide greater network bandwidth, on the other hand can also provide better reliability and port redundancy protection.

Bonding configuration has seven modes (from bond0 to bond6), respectively, to provide different transceiver and port redundancy mechanism, the uplink switch configuration and network card also have different requirements, need to choose according to different application scenarios to use.

There are three commonly used modes:
mode = 0: balanced load mode, with automatic backup, but need “Switch” support and settings.
Mode = 1: automatic backup mode, one line if broken, other lines will be automatically back up.
Mode = 6: Balanced load mode, with automatic backup, no “Switch” support and settings.

Bonding interface, there are two kinds of fault switching mechanism, one called MII monitor, that is, only monitor the status of the port, the other is ARP monitor, that is, by sending arp way to test the network connection status. MII monitor way is relatively simple, but there is a problem of inaccurate state detection, such as for the optical port card, if the transceiver of the two fibers appeared in one of the interruption of the situation, for the normal light, broken off the card, Can not detect the change of link state. ARP monitor is used to send arp query to see if there is no way to receive arp reply to test IP connectivity, you can also configure multiple Target to test, compared to MII monitor test results more accurate.

In rhel6 / CentOS 6 is the use of bonding technology dual network card binding technology, and rhel7.3 in the use of teaming technology, in fact, rhel7.3 dual NIC binding can use teaming can also use bonding, it is recommended to use Teaming technology, easy to view and monitor.

Teaming function mainly by the kernel team driver, used as a communication interface libteam lib and userspace teamd three parts, teaming also supports different modes of work, compared to bonding less balance-xor and balance-alb these two Kind of support, which balance-xor can be replaced by lacp, another balance-alb function is said after the teaming will also support.
Broadcast (data is transmitted over all ports)

Roundrobin (data is transmitted over all ports in turn)

Activebackup (one port or link is used while others are kept as a backup)

Loadbalance (with active Tx load balancing and BPF-based Tx port selectors)

Lacp (implements the 802.3ad Link Aggregation Control Protocol)

In essence, the purpose of teaming is to bind the function of the card from the kernel to move out, put these functions into the userspace to solve, keep the kernel simple, let it only do kernel should do.

This article describes rhel7.3 two of the most common dual-NIC binding mode:

(1) activebackup –
active and standby mode a network card is active, the other in a backup state, all traffic on the main link, when the activities When the card is down, enable the backup card.
(2) roundrobin – polling mode
All links are in load balancing state, this feature features increased bandwidth, while supporting fault tolerance.

Here to activebackup – master and backup mode as an example to do the following example configuration:

1, enter the system, see the server network card configuration.

 

As shown above, there are a total of four ports for ens3 and ens8. It is decided to configure dual network card bindings for the two network segments. The service network binds both the ens3f0 and ens8f0 ports. The private network binds both the ens3f1 and ens8f1 ports.
2, we can use the nmcli command for network card binding, the specific order is as follows:
configure the main business network team0, set the mode is activebackup
nmcli con add type team con-name team0 ifname team0 config ‘{“runner”: {“name” “Activebackup”}}
Set the IP address, subnet mask, gateway
nmcli con mod team0 ipv4.addresses 11.11.205.145/28ipv4.gateway 11.11.205.158 ipv4.method manual connectio.autoconnect yes
Add the port bound to team0 ens3f0
nmcli Con add type team-slave con-name team0-port1 ifname ens3f0 master team0
add the port bound to team0 ens8f0
nmcli con add type team-slave con-name team0-port2 ifname ens8f0 master team0
reload connection configuration
nmcli con reload
start Team0

nmcli con up team0

 

3, view the status, use the teamdctl command to verify

4, detection found that the state is normal.

5, if you need to try to change the roundrobin mode, you can enter the team0 and team1 configuration file, modify the mode for the roundrobin, other configuration unchanged.

Tip: When making a network card binding, if you find that the physical network card can not be bound to team0, please check whether the physical card is in the up state.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>