组网需求
如
图
3-22
所示,
switcha
和
switchb
通过以太链路分别都连接
vlan10
和
vlan20
的网络,且switcha
和
switchb
之间有较大的数据流量。用户希望
switcha
和
switchb
之间能够提供较大的链路带宽来使相同vlan
间互相通信。在两台
switch
设备上配置
lacp
模式链路聚合组,提高两设备之间的带宽与可靠性,具体要求如下:
● 两条活动链路具有负载分担的能力。
● 两设备间的链路具有1
条冗余备份链路,当活动链路出现故障时,备份链路替代故障链路,保持数据传输的可靠性。
● 同vlan
间可以相互通信。

配置思路
采用如下的思路配置
lacp
模式链路聚合:
1.
创建
eth-trunk
,配置
eth-trunk
为
lacp
模式,实现链路聚合功能。
2.
将成员接口加入
eth-trunk
。
3.
配置系统优先级,确定主动端,按照主动端设备的接口选择活动接口。
4.
配置活动接口上限阈值,实现保证带宽的情况下提高网络的可靠性。
5.
配置接口优先级,确定活动链路接口,优先级高的接口将被选作活动接口。
6.
创建
vlan
并将接口加入
vlan
。
操作步骤
步骤
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
发表评论