The NIC link aggregation linux

First, the card link aggregation

  • NIC link aggregation is to connect multiple network cards when a card is damaged, the network can still function properly, it can effectively prevent damage caused by the loss because the card, but also can improve network access speed.

  • NIC link aggregation are commonly used "bond" and "team" modes, "bond" mode can add up to two cards, "team" mode can add up to eight card.

Two, bond mode

Environment settings: requires the presence of two network interface card, remove the existing network connection.
Here Insert Picture Description

  nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.11/24   

Adding virtual devices (open interfaces) a bond, entitled bond0, model-based backup, ip as: 172.25.254.11

Here Insert Picture Description
View bond0 interface information.
-n 1 Watch "CAT / proc / NET / bonding / bond0"
Here Insert Picture Description
nmcli the Add Connection CON-name eth0 eth0 ifname of the type-Slave Master Bond bond0
add eth0 to bond0 Interface card devices present the first real
Here Insert Picture Descriptionnmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
adding a second NIC device actually exists bond0 eth1 interfaces to
Here Insert Picture Descriptionthe ping 172.25.254.7 finished adding devices, network detection, network may be used.
Here Insert Picture Description
As a result of the standby mode: When a network adapter card primarily operates, the other as a backup, when the abnormal stop working if the main card, the standby card takes over as the main card, to ensure uninterrupted network.

And using ifconfig eth0 down ifconfig eth0 up to close and open the card for simulation.
Here Insert Picture Description

  • If you want to delete the bond0 aggregated link, and then click Delete: bond0, eth0, eth1 can.

Here Insert Picture Description

Three, team mode

Environment settings: clear existing network connection, team using up to eight cards, the use of two experiments will be described.

Here Insert Picture Description
nmcli connection add con-name team0 ifname team0 type team config ‘{“runner”:{“name”:“activebackup”}}’ ip4 172.25.254.11/24

表示建立一个team,名称为team0,工作模式为主备,IP为172.25.47.104/24

Here Insert Picture Description
Here Insert Picture Description

teamdctl team0 state # 查看team0接口信息
watch -n 1 teamdctl team0 state# 对team0接口信息集进行监控
Here Insert Picture Description
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
添加第一个真实存在的网卡设备eth0到team0接口
Here Insert Picture Descriptionnmcli connection add con-name eth1 ifname eth1 type team-slave master team0
添加第二个真实存在的网卡设备eth1到team0接口
进行网路检测,当添加完成设备之后,网络可以使用。

Here Insert Picture DescriptionAs a result of the standby mode: When operating as a primary NIC card, as a further alternate, the abnormal stop working when the main card, the standby card takes over as the main card, to ensure uninterrupted network.
And using ifconfig eth0 down ifconfig eth up to close and open the card for simulation.
Here Insert Picture Description
If you want to delete the team0 aggregated link, and then click Delete: team0, eth0, eth1 can
nmcli the Delete Connection team0
nmcli the Delete Connection eth0
nmcli the Delete Connection eth1

Here Insert Picture Description
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/Y950904/article/details/91453515