链路聚合
1092 字
5 分钟
链路聚合

链路聚合
[TOC]
用户对骨干链路的带宽和可靠性提出了 越来越高的要求
在传统技术中,常用 更换高速率的接口板 或 更换支持高速率接口板 的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活
采用链路聚合技术可以在 不进行硬件升级的条件下 ,通过将多个物理接口捆绑为一个逻辑接口 ,来达到增加链路带宽的目的
在实现增大带宽目的的同时,链路聚合采用
备份链路的机制,可以有效的提高设备之间链路的可靠性

❤️链路聚合:把两台设备之间的多条物理链路聚合在一起,当做一条逻辑链路来使用
链路聚合能够提高
链路带宽,增强网络可用性,支持负载分担链路聚合这两台设备可以是
一对路由器
一对交换机
或者是一台路由器和一台交换机
链路聚合模式

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

# 首先我们先进行配置,PC机的IP地址,和子网掩码,不用配置网关地址# SW1<Huawei>sysEnter system view, return user view with Ctrl+Z.[Huawei]sys SW1[SW1]undo info enInfo: 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 1Info: 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 1Info: 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 1Info: 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/1trunkport g0/0/2trunkport 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 1GigabitEthernet0/0/2 UP 1GigabitEthernet0/0/5 UP 1
# 我们配置SW2[SW2]undo info enInfo: Information center is disabled.[SW2]inter Eth-Trunk 1[SW2-Eth-Trunk1]mode manual load-balance[SW2-Eth-Trunk1]trunkport g0/0/1Info: This operation may take a few seconds. Please wait for a moment...done.[SW2-Eth-Trunk1]trunkport g0/0/2Info: This operation may take a few seconds. Please wait for a moment...done.[SW2-Eth-Trunk1]trunkport g0/0/5Info: This operation may take a few seconds. Please wait for a moment...done.'这里用了一种新的方法去把接口加入到Eth-Trunk口'[SW2-Eth-Trunk1]q[SW2]dis inter eth-trunkEth-Trunk1 current state : UP.......-------------------------------------------------PortName Status Weight-------------------------------------------------GigabitEthernet0/0/1 UP 1GigabitEthernet0/0/2 UP 1GigabitEthernet0/0/5 UP 1# 查看链路聚合信息
# 测试一下PC>ping 10.0.1.2# PC1和PC2测试连通性Ping 10.0.1.2: 32 data bytes, Press Ctrl_C to breakFrom 10.0.1.2: bytes=32 seq=1 ttl=128 time=78 msFrom 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模式

文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
相关文章智能推荐
1
函数与数组
Shell脚本Shell函数定义与数组操作,涵盖局部/全局变量、递归函数及数组遍历
2
循环与case多分支
Shell脚本Shell循环结构与case多分支语句,涵盖for/while/until循环及实战脚本
3
数值运算与if条件判断
Shell脚本Shell数值运算方法与if条件判断结构,涵盖整数/字符串比较及文件测试
4
Shell编程基础
Shell脚本Shell脚本基础入门,涵盖变量、引号规则、条件测试及脚本调试方法
5
Ansible Docker 动态清单
Ansible自动化讲解Ansible与Docker集成及动态清单机制,涵盖容器化部署与inventory动态管理
随机文章随机推荐



