首页/网络/网络设备配置速查/服务器双网卡 bond 对接交换机(完整示例)
接口与链路73 条

服务器双网卡 bond 对接交换机(完整示例)

服务器双网卡聚合对接是重灾区:Linux bond 模式、交换机聚合模式、哈希模式三者都要匹配;本条目给出常见组合与验证方法。

网络设备配置速查网络更新于 2026-10-12
场景服务器双上联、数据库/存储节点高可用
适用服务器 + 交换机
命令族mode lacp-static / channel-group mode active / link-aggregation mode dynamic(对 bond 802.3ad)

华为 VRP

华为 VRP
[Huawei] interface Eth-Trunk 20
[Huawei-Eth-Trunk20] mode lacp-static
[Huawei-Eth-Trunk20] load-balance src-dst-ip
[Huawei-GigabitEthernet0/0/23] eth-trunk 20
[Huawei-GigabitEthernet0/0/24] eth-trunk 20

思科 IOS

思科 IOS
SW-A(config)# interface range GigabitEthernet1/0/23-24
SW-A(config-if-range)# channel-group 20 mode active
SW-A(config)# port-channel load-balance src-dst-ip
SW-A# show etherchannel 20 summary

H3C Comware

H3C Comware
[H3C] interface Bridge-Aggregation 20
[H3C-Bridge-Aggregation20] link-aggregation mode dynamic
[H3C-GigabitEthernet1/0/23] port link-aggregation group 20
[H3C-GigabitEthernet1/0/24] port link-aggregation group 20

服务器侧(Linux 示例)

服务器侧(Linux 示例)
# bonding 模式 4 = 802.3ad,与交换机 LACP 对应
ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate fast
ip link set eth0 down && ip link set eth0 master bond0
ip link set eth1 down && ip link set eth1 master bond0
cat /proc/net/bonding/bond0   # 查看成员状态与 LACP 信息
对接速查:交换机 LACP(active/lacp-static/dynamic)↔ Linux bond mode 4(802.3ad);交换机静态 ↔ bond mode 0/1(双端匹配)。服务器网卡最好两端都接交换机同一聚合组,链路两端 Up 后再看 bond 内成员是否都为 up。

易错点

  • bond mode 4 + 交换机静态聚合:bond 侧永远协商不上,成员口状态与预期不符
  • 哈希模式选错导致 bond 单流仍走单卡:iperf 单线程测不出聚合带宽是正常现象

数据来源与参考

  • Linux bonding 文档
  • 华为服务器双网卡聚合对接
  • Cisco 服务器 EtherChannel 对接

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌