Skip to content

Redhat/Rocky Network(Teaming) Setup

1. Teaming Mode

Mode introduction

Mode Name Describe HA 关键我点及适用场景
0 balance-rr 轮询 yes 数据包依次在每个slave接口上发送。**出站流量**负载均衡较公平,但某些环境可能无效。
1 active-backup 主备 no 只有一个slave处于活动状态,其余备份。活动接口故障时备份接口接管。资源利用率低,提供**高可用性**。
2 balance-xor XOR(异或)哈希策略 yes 根据源/目的MAC地址等的哈希计算,将同一会话的流量固定在一个slave上。保证会话一致性。
3 broadcast 广播 no 所有数据包在所有slave接口上发送。极度冗余但效率低,用于特定高可靠性要求场景。
4 802.3ad IEEE 802.3ad 动态链路聚合 (LACP) yes 创建共享相同速度和双工设置的聚合组。需要交换机支持**LACP协议**。标准化的聚合方式
5 balance-tlb 适配器传输负载均衡 yes 根据每个slave的当前负载分配传出流量,传入流量由当前slave接收。无需交换机特殊配置
6 balance-alb 适配器适应性负载均衡 yes 在mode 5基础上**增加了接收负载均衡功能**,通过ARP协商实现。无需交换机特殊配置

2. Teaming for Rack Server

DB Server suggest use mode 4

[!IMPORTANT]

使用mode 4(LACP)创建teaming时,必须需要交换机支持且需要联系网络管理员,将服务器接入的2个端口在交换机上做聚合设定

  • 2.1 Check the name of the network card that need to create Teaming
ip link

[!IMPORTANT]

如果条件允许,建议将不同网卡上的2个端口进行Teaming绑定

image-20250901141113280

  • 2.2 Create teaming adapter, and assign IP/Gateway/DNS..
nmcli connection add type team con-name team0 ifname team0 config '{"runner": {"name": "lacp"}}'
nmcli connection modify team0 ipv4.addresses "10.xx.xx.xx/24" ipv4.method manual
nmcli connection modify team0 ipv4.gateway 10.xx.xx.xx
nmcli connection modify team0 ipv4.dns 10.xx.xx.xx,10.xx.xx.xx,10.xx.xx.xx

image-20250901142032647

  • 2.3 Add network adapter (eno8303, eno12399) to team0
nmcli connection add type team-slave con-name eno8303 ifname eno8303 master team0
nmcli connection add type team-slave con-name eno12399 ifname eno12399 master team0

image-20250901142401596

  • 2.3 Configuration confirm
nmcli connection show

image-20250901142703351

  • 2.4 Enable team0
nmcli connection up team0
teamdctl team0 state view

image-20251001145720074