链路聚合

116 阅读2分钟

概述

  • 以太网链路聚合Eth-Trunk简称链路聚合,它通过将多条以太网物理链路捆绑在一起成为一条逻辑链路,从而实现增加链路带宽的目的。同时,这些捆绑在一起的链路通过相互间的动态备份,可以有效地提高链路的可靠性。

  • 链路聚合技术主要有以下三个优势:

    • 增加带宽

      链路聚合接口的最大带宽可以达到各成员接口带宽之和。

    • 提高可靠性

      当某条活动链路出现故障时,流量可以切换到其他可用的成员链路上,从而提高链路聚合接口的可靠性。

    • 负载分担

      在一个链路聚合组内,可以实现在各成员活动链路上的负载分担。

分类

手动模式

  • 无法检测到链路层故障、链路错连等故障

image-20240326103513900

LACP模式

  • 推荐使用该模式

LACP模式命令

  • 查看聚合链路信息
  1. dis Eth-Trunk
  • 创建聚合链路(编号:[0,63])
  1. int Eth-Trunk 编号
  • 切换模式为lacp模式
  1. mode lacp-static
  • 将物理接口加入到聚合链路中
  1. int g编号
  2. Eth-Trunk 聚合链路编号
  • 设置设备优先级,确定主设备(默认为32768,值越小优先级越高)
  1. lacp priority 优先级值
  • 设置活动接口上限
  1. int Eth-Trunk 聚合链路编号
  2. max active-linknumber 值
  • 配置接口优先级,确定活动链路
  1. int g编号
  2. lacp priority 值
  • 开启抢占模式(默认未开启)
  1. int Eth-Trunk 聚合链路编号
  2. lacp preempt enable

案例

image-20240326110642052

LSW1:

  1. sys
  2. int Eth-Trunk 1
  3. mode lacp-static
  4. q
  5. int g0/0/1
  6. Eth-Trunk 1
  7. int g0/0/10
  8. Eth-Trunk 1
  9. lacp priority 100
  10. int g0/0/20
  11. Eth-Trunk 1
  12. lacp priority 100
  13. q
  14. lacp priority 120
  15. int Eth-Trunk 1
  16. max active-linknumber 2
  17. lacp preempt enable

LSW2:

  1. sys
  2. int Eth-Trunk 1
  3. mode lacp-static
  4. q
  5. int g0/0/1
  6. Eth-Trunk 1
  7. int g0/0/10
  8. Eth-Trunk 1
  9. lacp priority 100
  10. int g0/0/20
  11. Eth-Trunk 1
  12. lacp priority 100
  13. q
  14. int Eth-Trunk 1
  15. max active-linknumber 2
  16. lacp preempt enable