HUAWEI交换机配置链路聚合

Auth:张老道       Date:2024/09/12       Cat:技术       Word:共4412字       Views:186

HUAWEI配置说明:

HUAWEI交换机配置链路聚合

配置思路

采用如下的思路配置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>language-mode Chinese       切换成中文按Y
[HUAWEI] sysname SwitchA
[SwitchA] interface eth-trunk 1     创建ID为1的Eth-Trunk接口
[SwitchA-Eth-Trunk1] mode lacp      配置链路聚合模式为LACP模式
[SwitchA-Eth-Trunk1] quit

配置Eth-Trunk1的负载分担方式。SwitchB的配置与SwitchA类似

[SwitchA] interface eth-trunk 1
[SwitchA-Eth-Trunk1] load-balance src-dst-mac     配置Eth-Trunk1基于源MAC地址与目的MAC地址进行负载分担
[SwitchA-Eth-Trunk1] quit

2.配置SwitchA上的成员接口加入Eth-Trunk1。SwitchB的配置与SwitchA类似

[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] eth-trunk 1     将GE0/0/1接口加入Eth-Trunk1中
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] eth-trunk 1     将GE0/0/2接口加入Eth-Trunk1中
[SwitchA-GigabitEthernet0/0/2] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] eth-trunk 1     将GE0/0/3接口加入Eth-Trunk1中
[SwitchA-GigabitEthernet0/0/3] quit

3.在SwitchA上配置系统优先级为100,使其成为LACP主动端

[SwitchA] lacp priority 100     系统LACP优先级缺省为32768,修改SwitchA的优先级大于SwitchB的优先级,作为主动端

4.在SwitchA上配置活动接口上限阈值为2

[SwitchA] interface eth-trunk 1
[SwitchA-Eth-Trunk1] max active-linknumber 2     链路聚合组活动接口数的上限阈值缺省是8,修改活动接口数的上限阈值为2
[SwitchA-Eth-Trunk1] quit

5.在SwitchA上配置接口优先级确定活动链路

[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] lacp priority 100     接口LACP优先级缺省为32768,修改GE0/0/1接口的LACP优先级为100,作为活动接口
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] lacp priority 100     接口LACP优先级缺省为32768,修改GE0/0/2接口的LACP优先级为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     设置接口链路类型为trunk,接口缺省链路类型不是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     设置接口链路类型为trunk,接口缺省链路类型不是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     设置接口链路类型为trunk,接口缺省链路类型不是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      11110000     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      11100000

通过以上显示信息可以看到,SwitchA的系统优先级为100,高于SwitchB的系统优先级。Eth-Trunk的成员接口中GigabitEthernet0/0/1、GigabitEthernet0/0/2成为活动接口,处于“Selected”状态,接口GigabitEthernet0/0/3处于“Unselect”状态,同时实现M条链路的负载分担和N条链路的冗余备份功能

《HUAWEI交换机配置链路聚合》留言数:1

发表留言