端口聚合

2021/5/23 18:25:13

本文主要是介绍端口聚合,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

验证理论:

  1. 验证默认为手工聚合模式
  2. 验证链路聚合两边的聚合组号可以不相同
  3. 割接:在对业务影响最小的前提下将手工链路聚合修改为LACP链路聚合
  4. 验证LACP主动端选举原则:设备优先级默认32768越小越优先,优先级相同,比较MAC地址,也是越小越优先
  5. 验证LACP活动端口选举原则:接口优先级默认32768越小越优先,优先级相同,比较MAC地址,也是越小越优先

 

 

实验拓扑:

 

 

 

一.

实验目的:

验证默认为手动聚合模式

实验步骤:

添加链路聚合组,加入成员端口,不指定聚合模式

[LSW1]int Eth-Trunk 1

[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 to 0/0/3

[LSW1]dis eth-trunk 1
Eth-Trunk1's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
PortName Status Weight
GigabitEthernet0/0/2 Up 1
GigabitEthernet0/0/3 Up 1

实验结论:

所以默认为手动聚合模式

 

 

二.

实验目的:

验证链路聚合两边的聚合组号可以不同

实验步骤:

[LSW1]int Eth-Trunk 1
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 to 0/0/3

[LSW2]int Eth-Trunk 2
[LSW2-GigabitEthernet0/0/2]eth-trunk 2
[LSW2-GigabitEthernet0/0/3]eth-trunk 2

[LSW2]dis eth-trunk 2
Eth-Trunk2's state information is:
Local:
LAG ID: 2 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccc1-6203
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/2 Selected 1GE 32768 3 561 10111100 1
GigabitEthernet0/0/3 Selected 1GE 32768 4 561 10111100 1

Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/2 32768 4c1f-ccda-7331 32768 3 305 10111100
GigabitEthernet0/0/3 32768 4c1f-ccda-7331 32768 4 305 10111100

 

实验结论:

所以聚合组号仅具有本地意义,两边可以不同

 

 

三.

实验目的:

在对业务影响最小的前提下将手工链路聚合修改为LACP链路聚合

实验步骤:

第一步,打开PC上的长ping模拟业务运行

第二步,设置SW之间的STP为MSTP加速收敛

[LSW1]stp mode mstp

[LSW2]stp mode mstp

第三步,在LSW1和2中间再添加一个聚合组,调整接口stp cost,使业务流量走临时新建立的聚合组

[LSW1]int Eth-Trunk 10
[LSW1-Eth-Trunk10]trunkport GigabitEthernet 0/0/4 to 0/0/5
[LSW1-Eth-Trunk10]p l a
[LSW1-Eth-Trunk10]p d v 10

[LSW2]int Eth-Trunk 10
[LSW2-Eth-Trunk10]trunkport GigabitEthernet 0/0/4 0/0/5
[LSW2-Eth-Trunk10]p l a
[LSW2-Eth-Trunk10]p d v 10

经查看LSW1为根桥

[LSW1]dis stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge :32768.4c1f-ccda-7331
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.4c1f-ccc1-6203 / 10000
CIST RegRoot/IRPC :32768.4c1f-ccda-7331 / 0

修改LSW2的接口cost

[LSW2-Eth-Trunk1]stp cost 100

产生大量丢包后自动恢复

  注释:因为ENSP的交换机在接收到TC报文后无法将设备上已经学习到的MAC地址老化时间强制修改为15s,这是一个bug。据说在真机上只会丢几个包,客户实际体验不到网络变化

 

 

 

 

第四步,修改之前的聚合组为LACP,调整接口stp cost,使业务流量走之前的聚合组

尝试修改模式时提示报错,需要先将接口移出

[LSW1-Eth-Trunk1]mode lacp-static
Error: Error in changing trunk working mode. There is(are) port(s) in the trunk

[LSW1-Eth-Trunk1]undo trunkport GigabitEthernet 0/0/2 0/0/3

[LSW1-Eth-Trunk1]mode lacp-static 

[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 0/0/3

2配置相同

[LSW1]dis eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccda-7331
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/2 Selected 1GE 32768 3 305 10111100 1
GigabitEthernet0/0/3 Selected 1GE 32768 4 305 10111100 1

Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/2 32768 4c1f-ccc1-6203 32768 3 561 10111100
GigabitEthernet0/0/3 32768 4c1f-ccc1-6203 32768 4 561 10111100

 

第五步,撤销临时聚合组,割接完成

直接删除时,提示报错需要先删除成员

[LSW1]undo interface Eth-Trunk 10
Info: This operation may take a few seconds. Please wait for a moment...failed.
Error: Because there are member interfaces in the Trunk interface, this configuration is not allowed.

[LSW1-Eth-Trunk10]undo trunkport GigabitEthernet 0/0/4 0/0/5
[LSW1]undo int Eth-Trunk 10

LSW2类似

 

 

四/五.

实验目的:

验证LACP主动端与活动端口选举原则

实验步骤:

第一步,将4,5添加进入之前的组中,使成员端口变成4。设置活动接口为2,开启抢占模式

[LSW1-Eth-Trunk1]max active-linknumber 2

第二步,修改LSW1的2,3端口优先级为0;LSW2的4,5端口优先级为0

[LSW1-GigabitEthernet0/0/2]lacp priority 0 

[LSW1-GigabitEthernet0/0/3]lacp priority 0

[LSW1]dis eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccda-7331
Least Active-linknumber: 1 Max Active-linknumber: 2
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/2 Unselect 1GE 0 3 305 10100000 1
GigabitEthernet0/0/3 Unselect 1GE 0 4 305 10100000 1
GigabitEthernet0/0/4 Selected 1GE 32768 5 305 10111100 1
GigabitEthernet0/0/5 Selected 1GE 32768 6 305 10111100 1

Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/2 32768 4c1f-ccc1-6203 32768 3 561 10100000
GigabitEthernet0/0/3 32768 4c1f-ccc1-6203 32768 4 561 10100000
GigabitEthernet0/0/4 32768 4c1f-ccc1-6203 0 5 561 10111100
GigabitEthernet0/0/5 32768 4c1f-ccc1-6203 0 6 561 10111100

[LSW2]dis eth-trunk 2
Eth-Trunk2's state information is:
Local:
LAG ID: 2 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccc1-6203

分析:选择端口为2,3端口,因为两边交换机的优先级均为默认32768,LSW2的MAC:4c1f-ccc1-6203小于LSW1的MAC:4c1f-ccda-7331。所以LSW2为主,选择活动端口,根据比较原则,选择优先级最小的4和5口。LSW1为从,所以活动的接口是4和5口

第三步,修改LSW1的系统优先级为4096

[LSW1]lacp priority 4096

等待协商过程之后

[LSW2]dis eth-trunk 2
Eth-Trunk2's state information is:
Local:
LAG ID: 2 WorkingMode: STATIC
Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccc1-6203
Least Active-linknumber: 1 Max Active-linknumber: 2
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/2 Selected 1GE 32768 3 561 10111100 1
GigabitEthernet0/0/3 Selected 1GE 32768 4 561 10111100 1
GigabitEthernet0/0/4 Unselect 1GE 0 5 561 10100000 1
GigabitEthernet0/0/5 Unselect 1GE 0 6 561 10100000 1

Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/2 4096 4c1f-ccda-7331 0 3 305 10111100
GigabitEthernet0/0/3 4096 4c1f-ccda-7331 0 4 305 10111100
GigabitEthernet0/0/4 4096 4c1f-ccda-7331 32768 5 305 10100000
GigabitEthernet0/0/5 4096 4c1f-ccda-7331 32768 6 305 10100000

此时LSW1成为主,其设备上的端口优先级更小的1,2成为活动端口

所以,设备主从选举优先级比小,优先级相同,MAC地址比小。

活动端口选举,接口优先级比小,接口优先级相同,MAC地址比小。

 



这篇关于端口聚合的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程