实验
理解链路聚合的作用和配置
拓扑
此时存在拓扑存在环路,配置STP生成树,STP生成树通过阻塞端口破环,这样两条链路将不会工作,在此场景下有更好的方式解决,链路聚合,将GE0/0/1-3绑定为一根逻辑的链路,在传输流量时,以负载均衡的方式分担给三条链路,因为是逻辑上的一条链路,所以没有环,还不会环,接下来配置链路聚合,将三条链路合为一条逻辑链路
配置
配置LSW1和LSW2之间的链路为链路聚合
PC1配置,PC2参考PC1
LSW1配置
<Huawei>sys
[Huawei]sys LSW1
[LSW1]interface Eth-Trunk 1 \\创建一个逻辑口
[LSW1-Eth-Trunk1]mode manual load-balance \\手工聚合模式(手动将成员接口加入),且开启负载均衡
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 \\将物理接口绑定到逻辑口上
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/3
LSW2配置
<Huawei>sys
[Huawei]sys LSW2
[LSW2]inte Eth-Trunk 1
[LSW2-Eth-Trunk1]mode manual load-balance
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/2
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3
验证
查看逻辑接口状态
[LSW1]dis interface Eth-Trunk 1
Eth-Trunk1 current state : UP
Line protocol current state : UP
Description:
Switch Port, PVID : 1, Hash arithmetic : According to SIP-XOR-DIP,Maximal BW:
3G, Current BW: 3G, The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-cc68-0339
Current system time: 2023-09-20 17:28:24-08:00
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
-----------------------------------------------------
PortName Status Weight
-----------------------------------------------------
GigabitEthernet0/0/1 UP 1 //链路状态都为UP,权重为1,根据权重负载均衡分配流量
GigabitEthernet0/0/2 UP 1
GigabitEthernet0/0/3 UP 1
-----------------------------------------------------
The Number of Ports in Trunk : 3
The Number of UP Ports in Trunk : 3
查看stp状态,可以发现三个接口被划分为一个逻辑接口,所以不会出现阻塞状态的接口,都处于工作状态
[LSW2]dis stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/4 DESI FORWARDING NONE
0 Eth-Trunk1 ROOT FORWARDING NONE
[LSW1]dis stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/4 DESI FORWARDING NONE
0 Eth-Trunk1 DESI FORWARDING NONE
PC1 ping PC2(通信正常)
PC>ping 192.168.1.2
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=128 time=47 ms
From 192.168.1.2: bytes=32 seq=2 ttl=128 time=62 ms
From 192.168.1.2: bytes=32 seq=3 ttl=128 time=63 ms
From 192.168.1.2: bytes=32 seq=4 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=5 ttl=128 time=78 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/65/78 ms
标签:LSW2,Trunk1,LSW1,聚合,16,192.168,链路,Eth
From: https://www.cnblogs.com/Metkey/p/17717934.html