链路聚合

1092 字
5 分钟
链路聚合

链路聚合#

[TOC]


用户对骨干链路的带宽和可靠性提出了 越来越高的要求

在传统技术中,常用 更换高速率的接口板更换支持高速率接口板 的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活

  • 采用链路聚合技术可以在 不进行硬件升级的条件下 ,通过将多个物理接口捆绑为一个逻辑接口 ,来达到增加链路带宽的目的

  • 在实现增大带宽目的的同时,链路聚合采用 备份链路 的机制,可以有效的提高设备之间链路的 可靠性

image-20260130085624903
image-20260130085624903

❤️链路聚合:把两台设备之间的多条物理链路聚合在一起,当做一条逻辑链路来使用​

  • 链路聚合能够提高 链路带宽 ,增强网络可用性 ,支持 负载分担

  • 链路聚合这两台设备可以是

    一对路由器

    一对交换机

    或者是一台路由器和一台交换机

链路聚合模式#

image-20260130090854202
image-20260130090854202

两种模式简要对比:

  • 手动负载均衡模式
    • 所有成员链路都参与转发
    • 平均分担流量
    • 无备份链路
    • 适用于不支持LACP的设备
  • 静态LACP模式(M
    • 通过LACP协商确定 活动链路(M)备份链路(N)
    • 活动链路负载分担,故障时由高优先级备份链路接管

基础实验#

image-20260130093524495
image-20260130093524495

Terminal window
# 首先我们先进行配置,PC机的IP地址,和子网掩码,不用配置网关地址
# SW1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]undo info en
Info: Information center is disabled.
[SW1]inter Eth-Trunk ?
<0-63> Eth-Trunk interface number
# trunk-id 用于唯一识别一个Eth-Trunk口
# 该参数的取值可以是0-63之间的任何一个整数
'✅对端设备的 Eth-Trunk 接口号不需要和本端相同,聚合能否成功与接口编号无关'
[SW1]inter Eth-Trunk 1
# 这条命令用于配置链路聚合,创建了一个Eth-Trunk口,并且进入到对应的视图
[SW1-Eth-Trunk1]mode ?
'进入到Eth-Trunk 后,先配置其模式'
mode manual load-balance # 手动负载分担配置
mode lacp-static # 静态LACP模式
[SW1-Eth-Trunk1]mode manual load-balance
# 设置为手动负载分担模式
[SW1-Eth-Trunk1]q
[SW1]inter g0/0/1
[SW1-GigabitEthernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
# 将g0/0/1加入到eth-trunk 1口
[SW1-GigabitEthernet0/0/1]inter g0/0/2
[SW1-GigabitEthernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
# 将g0/0/2加入到eth-trunk 1口
[SW1-GigabitEthernet0/0/2]inter g0/0/5
[SW1-GigabitEthernet0/0/5]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
'这样三个接口都加入到了eth-trunk 1口'
--------------------------------
# 我们还有一种把接口加入到eth-trunk口的方式
inter Eth-Trunk 1
# 先进入到eth-trunk口
trunkport g0/0/1
trunkport g0/0/2
trunkport g0/0/5
# 再把接口加入到里面
--------------------------------
[SW1-GigabitEthernet0/0/5]q
[SW1]dis inter eth-trunk
# 查看链路聚合信息
Eth-Trunk1 current state : UP
...................
Current system time: 2026-01-30 09:46:59-08:00
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
-----------------------------------------------
PortName Status Weight
-----------------------------------------------
GigabitEthernet0/0/1 UP 1
GigabitEthernet0/0/2 UP 1
GigabitEthernet0/0/5 UP 1
# 我们配置SW2
[SW2]undo info en
Info: Information center is disabled.
[SW2]inter Eth-Trunk 1
[SW2-Eth-Trunk1]mode manual load-balance
[SW2-Eth-Trunk1]trunkport g0/0/1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2-Eth-Trunk1]trunkport g0/0/2
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2-Eth-Trunk1]trunkport g0/0/5
Info: This operation may take a few seconds. Please wait for a moment...done.
'这里用了一种新的方法去把接口加入到Eth-Trunk口'
[SW2-Eth-Trunk1]q
[SW2]dis inter eth-trunk
Eth-Trunk1 current state : UP
.......
-------------------------------------------------
PortName Status Weight
-------------------------------------------------
GigabitEthernet0/0/1 UP 1
GigabitEthernet0/0/2 UP 1
GigabitEthernet0/0/5 UP 1
# 查看链路聚合信息
# 测试一下
PC>ping 10.0.1.2
# PC1和PC2测试连通性
Ping 10.0.1.2: 32 data bytes, Press Ctrl_C to break
From 10.0.1.2: bytes=32 seq=1 ttl=128 time=78 ms
From 10.0.1.2: bytes=32 seq=2 ttl=128 time=47 ms

注意事项#

注意事项

  • 配置 Eth-Trunk 口时,两端接口类型需要保持一致

    两端的接口类型(如 access、trunk、hybrid)和模式必须匹配

    否则无法正常通信

  • 成员接口必须属于同一类型

    不能混用不同速率或介质类型的接口

    如果成员口的速率不同,速率较低的接口可能会阻塞,报文可能被丢弃

  • 只能删除不包含任何成员的Eth-Trunk口

  • 把接口加入到Eth-Trunk口时

    二层Eth-Trunk口的成员必须是二层接口

    三层Eth-Trunk口的成员必须是三层接口

  • 一个Eth-Trunk口最多可以加入8个成员口

LACP模式#

image-20260130105929842
image-20260130105929842

文章分享

如果这篇文章对你有帮助,欢迎分享给更多人!

链路聚合
https://www.kpyun.fun/posts/network/network08/
作者
久棹
发布于
2026-02-12
许可协议
CC BY-NC-SA 4.0
Profile Image of the Author
久棹
只要胆子大,天天寒暑假!
公告
欢迎来到久棹的技术小站!本站专注 Linux 运维学习笔记分享,如有问题欢迎交流探讨 🎉
分类
标签
站点统计
文章
98
分类
11
标签
203
总字数
244,453
运行时长
0
最后活动
0 天前
站点信息
构建平台
Local
博客版本
Firefly v6.13.5
文章许可
CC BY-NC-SA 4.0

文章目录