1. 实验目的
- 掌握使用静态LACP模式配置链路聚合的方法
- 掌握控制静态LACP模式下控制活动链路的方法
- 掌握静态LACP的部分特性的配置
- 实验拓扑
实验拓扑如图11-12所示:
图11-12以太网聚合LACP模式
3. 实验步骤
- PC机IP地址的配置
PC1的配置,在ipv4下选择静态配置,输入对应的ip地址以及子网掩码,然后点击应用。PC2、PC3、PC4同理。PC1的配置如图11-13所示:
图11-13在PC1上手动添加IP地址
PC2的配置如图11-14所示:
图11-14在PC2上手动添加IP地址
PC3的配置如图11-15所示:
图11-15在PC3上手动添加IP地址
PC4的配置如图11-16所示:
图11-16在PC4上手动添加IP地址
- 在LSW1和LSW2上创建VLAN10、20,把接口划入到VLAN
LSW1的配置
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname LSW1
[LSW1]vlan batch 10 20
[LSW1]interface g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 10
[LSW1-GigabitEthernet0/0/1]quit
[LSW1]interface g0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 20
[LSW1-GigabitEthernet0/0/2]quit
LSW2的配置
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname LSW2
[LSW2]vlan batch 10 20
[LSW2]interface g0/0/1
[LSW2-GigabitEthernet0/0/1]port link-type access
[LSW2-GigabitEthernet0/0/1]port default vlan 10
[LSW2-GigabitEthernet0/0/1]quit
[LSW2]interface g0/0/2
[LSW2-GigabitEthernet0/0/2]port link-type access
[LSW2-GigabitEthernet0/0/2]port default vlan 20
[LSW2-GigabitEthernet0/0/2]quit
- 在LSW1和LSW2上设置eth-trunk
LSW1的配置
[LSW1]interface Eth-Trunk 1
[LSW1-Eth-Trunk1]mode lacp-static //配置工作模式为lacp静态模式
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/6 //将G0/0/3到G0/0/6加入到成员接口
[LSW1-Eth-Trunk1]port link-type trunk
[LSW1-Eth-Trunk1]port trunk allow-pass vlan 10 20
[LSW1-Eth-Trunk1]quit
LSW2的配置
[LSW2]interface Eth-Trunk 1
[LSW2-Eth-Trunk1]mode lacp-static
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/6
[LSW2-Eth-Trunk1]port link-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan 10 20
[LSW2-Eth-Trunk1]quit
4、实验调试
(1)查看E-Trunk的相关信息
[LSW1]display 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-cc8e-641d
Least Active-linknumber: 1 Max Active-linknumber: 4
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/3 Selected 1GE 32768 4 305 10111100 1
GigabitEthernet0/0/4 Selected 1GE 32768 5 305 10111100 1
GigabitEthernet0/0/5 Selected 1GE 32768 6 305 10111100 1
GigabitEthernet0/0/6 Unselect 1GE 32768 7 305 10110000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/3 32768 4c1f-cc3a-3420 32768 4 305 10111100
GigabitEthernet0/0/4 32768 4c1f-cc3a-3420 32768 5 305 10111100
GigabitEthernet0/0/5 32768 4c1f-cc3a-3420 32768 6 305 10111100
GigabitEthernet0/0/6 32768 4c1f-cc3a-3420 32768 7 305 10100000
以上输出表明基于lacp的静态模式的聚合链路已经形成,具体含义如下;。
①Lag id表示该聚合口的编号为1。
②WorkingMode: STATIC表示该聚合口的工作模式为lacp静态模式。
③System Priority: 32768表示SW1的系统lacp优先级为32768。
④Max Active-linknumber: 8 表示最大的活动接口数量为8个。
⑤Status表示活动接口的状态,Selected:表示该成员口被选中,成为活动接口。
⑥Unselect:表示该成员口未被选中。
⑦PortType代表本地成员接口的类型。
⑧PortPri代表成员接口的LACP优先级。
⑨PortNo代表成员接口在LACP中的编号。
⑩PortKey代表成员接口在LACP中的Key值。
⑪PortState代表成员接口的状态变量。
(2)手动定义活动端口阈值
[LSW1]interface Eth-Trunk 1
[LSW1-Eth-Trunk1]max active-linknumber 2
[LSW1-Eth-Trunk1]quit
(3)查看配置结果
[LSW1]display 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-cc8e-641d
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/3 Selected 1GE 32768 4 305 10111100 1
GigabitEthernet0/0/4 Selected 1GE 32768 5 305 10111100 1
GigabitEthernet0/0/5 Unselect 1GE 32768 6 305 10100000 1
GigabitEthernet0/0/6 Unselect 1GE 32768 7 305 10100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/3 32768 4c1f-cc3a-3420 32768 4 305 10111100
GigabitEthernet0/0/4 32768 4c1f-cc3a-3420 32768 5 305 10111100
GigabitEthernet0/0/5 32768 4c1f-cc3a-3420 32768 6 305 10100000
GigabitEthernet0/0/6 32768 4c1f-cc3a-3420 32768 7 305 10100000
通过以上输出可知,修改了最大活动链路的数目为2,现在有4条链路,所以有二条链路为非活动链路,根据端口号,默认选择g0/0/5 和g0/0/6为非活动接口。
(4)在LSW1上把系统LACP优先级改成99,让其成为主动端
[LSW1]lacp priority 99
(5)在LSW1上查看结果
[LSW1]display 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: 99 System ID: 4c1f-cc8e-641d
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/3 Selected 1GE 32768 4 305 10111100 1
GigabitEthernet0/0/4 Selected 1GE 32768 5 305 10111100 1
GigabitEthernet0/0/5 Unselect 1GE 32768 6 305 10100000 1
GigabitEthernet0/0/6 Unselect 1GE 32768 7 305 10100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/3 32768 4c1f-cc3a-3420 32768 4 305 10111100
GigabitEthernet0/0/4 32768 4c1f-cc3a-3420 32768 5 305 10111100
GigabitEthernet0/0/5 32768 4c1f-cc3a-3420 32768 6 305 10100000
GigabitEthernet0/0/6 32768 4c1f-cc3a-3420 32768 7 305 10100000
通过以上输出可以看到,LSW1的优先级变也了99,成为了主动端。
(6)在LSW1上把接口g0/0/5和g0/0/6的优先级变成88,让这两个接口成为活动接口
[LSW1]interface g0/0/5
[LSW1-GigabitEthernet0/0/5]lacp priority 88
[LSW1-GigabitEthernet0/0/5]quit
[LSW1]interface g0/0/6
[LSW1-GigabitEthernet0/0/6]lacp priority 88
[LSW1-GigabitEthernet0/0/6]quit
(7)查看结果
[LSW1]display 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: 99 System ID: 4c1f-cc8e-641d
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/3 Selected 1GE 32768 4 305 10111100 1
GigabitEthernet0/0/4 Selected 1GE 32768 5 305 10111100 1
GigabitEthernet0/0/5 Unselect 1GE 88 6 305 10100000 1
GigabitEthernet0/0/6 Unselect 1GE 88 7 305 10100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/3 32768 4c1f-cc3a-3420 32768 4 305 10111100
GigabitEthernet0/0/4 32768 4c1f-cc3a-3420 32768 5 305 10111100
GigabitEthernet0/0/5 32768 4c1f-cc3a-3420 32768 6 305 10100000
GigabitEthernet0/0/6 32768 4c1f-cc3a-3420 32768 7 305 10100000
通过以上输出可以看到,端口优先虽然变成了88,但是g0/0/5、g0/0/6还是没有成为活动接口,因为我们没有开启抢占功能。
(7)开启抢占功能
[LSW1]interface Eth-Trunk 1
[LSW1-Eth-Trunk1]lacp preempt enable
[LSW1-Eth-Trunk1]quit
再次查看结果
[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay Time: 10 Hash arithmetic: According to SIP-XOR-DIP
System Priority: 99 System ID: 4c1f-cc8e-641d
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/3 Unselect 1GE 32768 4 305 10100000 1
GigabitEthernet0/0/4 Unselect 1GE 32768 5 305 10100000 1
GigabitEthernet0/0/5 Selected 1GE 88 6 305 10111100 1
GigabitEthernet0/0/6 Selected 1GE 88 7 305 10111100 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/3 32768 4c1f-cc3a-3420 32768 4 305 10100000
GigabitEthernet0/0/4 32768 4c1f-cc3a-3420 32768 5 305 10100000
GigabitEthernet0/0/5 32768 4c1f-cc3a-3420 32768 6 305 10111100
GigabitEthernet0/0/6 32768 4c1f-cc3a-3420 32768 7 305 10111100
通过以上输出可以看到g0/0/5、g0/0/6已经成了活动接口
【技术要点】
LACP为交换数据的设备提供一种标准的协商方式,以供设备根据自身配置自动形成聚合链路并启动聚合链路收发数据。聚合链路形成以后,LACP负责维护链路状态,在聚合条件发生变化时,自动调整或解散链路聚合。
在lacp模式中需要选择主动端和被动端,由主动端来决定活动接口数量以及活动接口。系统优先级数值低的为主动端设备,优先级一样则比较mac地址的大小,越小越优先。活动接口则比较接口优先级,优先级数值低的优选为活动接口,数值一样则比较接口编号的大小,越小越优先。
本文出自作者的《HCIA Datacom学习指南》
https://item.jd.com/14032255.html
在文章最后加作者VX:可以免费领取以下资料