操作步骤
步骤
1
在
SwitchA
上创建
Eth-Trunk1
并配置为
LACP
模式。
SwitchB
的配置与
SwitchA
类似,不
再赘述
<HUAWEI>
system-view
[HUAWEI]
sysname SwitchA
[SwitchA]
interface eth-trunk 1
[SwitchA-Eth-Trunk1]
mode lacp
[SwitchA-Eth-Trunk1]
quit
步骤
2
配置
SwitchA
上的成员接口加入
Eth-Trunk
。
SwitchB
的配置与
SwitchA
类似,不再赘述
[SwitchA]
interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1]
eth-trunk 1
[SwitchA-GigabitEthernet0/0/1]
quit
[SwitchA]
interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2]
eth-trunk 1
[SwitchA-GigabitEthernet0/0/2]
quit
[SwitchA]
interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3]
eth-trunk 1
[SwitchA-GigabitEthernet0/0/3]
quit
步骤
3
在
SwitchA
上配置系统优先级为
100
,使其成为
LACP
主动端
[SwitchA]
lacp priority 100
步骤
4
在
SwitchA
上配置活动接口上限阈值为
2
[SwitchA]
interface eth-trunk 1
[SwitchA-Eth-Trunk1]
max active-linknumber 2
[SwitchA-Eth-Trunk1]
quit
步骤
5
在
SwitchA
上配置接口优先级确定活动链路
[SwitchA]
interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1]
lacp priority 100
[SwitchA-GigabitEthernet0/0/1]
quit
[SwitchA]
interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2]
lacp priority 100
[SwitchA-GigabitEthernet0/0/2]
quit
步骤
6
创建
VLAN
并将接口加入
VLAN
。
#
创建
VLAN10
和
VLAN20
并分别加入接口。
SwitchB
的配置与
SwitchA
类似,不再赘
述。
[SwitchA]
vlan batch 10 20
[SwitchA]
interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4]
port link-type trunk
[SwitchA-GigabitEthernet0/0/4]
port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/4]
quit
[SwitchA]
interface gigabitethernet 0/0/5
[SwitchA-GigabitEthernet0/0/5]
port link-type trunk
[SwitchA-GigabitEthernet0/0/5]
port trunk allow-pass vlan 20
[SwitchA-GigabitEthernet0/0/5]
quit
#
配置
Eth-Trunk1
接口允许
VLAN10
和
VLAN20
通过。
SwitchB
的配置与
SwitchA
类似,
不再赘述。
[SwitchA]
interface eth-trunk 1
[SwitchA-Eth-Trunk1]
port link-type trunk
[SwitchA-Eth-Trunk1]
port trunk allow-pass vlan 10 20
[SwitchA-Eth-Trunk1]
quit
步骤
7
验证配置结果
#
查看各
Switch
设备的
Eth-Trunk
信息,查看链路是否协商成功。
[SwitchA]
display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID:
1
WorkingMode:
LACP
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority:
100
System ID: 00e0-fca8-0417
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/1
Selected
1GE 100 6145 2865 11111100 1
GigabitEthernet0/0/2
Selected
1GE 100 6146 2865 11111100 1
GigabitEthernet0/0/3
Unselect
1GE 32768 6147 2865 11100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/1 32768 00e0-fca6-7f85 32768 6145 2609 11111100
GigabitEthernet0/0/2 32768 00e0-fca6-7f85 32768 6146 2609 11111100
GigabitEthernet0/0/3 32768 00e0-fca6-7f85 32768 6147 2609 11110000
[SwitchB]
display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID:
1
WorkingMode:
LACP
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 00e0-fca6-7f85
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/1
Selected
1GE 32768 6145 2609 11111100 1
GigabitEthernet0/0/2
Selected
1GE 32768 6146 2609 11111100 1
GigabitEthernet0/0/3
Unselect
1GE 32768 6147 2609 11100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/1 100 00e0-fca8-0417 100 6145 2865 11111100
GigabitEthernet0/0/2 100 00e0-fca8-0417 100 6146 2865 11111100
GigabitEthernet0/0/3 100 00e0-fca8-0417 32768 6147 2865 11110000
通过以上显示信息可以看到,
SwitchA
的系统优先级为
100
,高于
SwitchB
的系统优先级。Eth-Trunk
的成员接口中
GigabitEthernet0/0/1
、
GigabitEthernet0/0/2
成为活动接口,处于“Selected
”状态,接口
GigabitEthernet0/0/3
处于“
Unselect
”状态,同时实现M
条链路的负载分担和
N
条链路的冗余备份功能。
----
结束
配置文件
● SwitchA
的配置文件
#
sysname SwitchA
#
vlan batch 10 20
#
lacp priority 100
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20
mode lacp
max active-linknumber 2
#
interface GigabitEthernet0/0/1
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/2
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 20
#
return
● SwitchB
的配置文件
#
sysname SwitchB
#
vlan batch 10 20
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20
mode lacp
#
interface GigabitEthernet0/0/1
eth-trunk 1
#
interface GigabitEthernet0/0/2
eth-trunk 1
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 20
#
return