链路聚合(LACP)
1、手工链路聚合
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] interface eth-trunk 1 //创建ID为1的Eth-Trunk接口
[SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/1 to 0/0/3 //在Eth-Trunk1接口中加入GE0/0/1到GE0/0/3三个成员接口
[SwitchA-Eth-Trunk1] port link-type trunk //设置接口链路类型为trunk,接口缺省链路类型不是trunk口
[SwitchA-Eth-Trunk1] port trunk allow-pass vlan 5 10
[SwitchA-Eth-Trunk1] load-balance src-dst-mac //配置Eth-Trunk1基于源MAC地址与目的MAC地址进行负载分担
[SwitchA-Eth-Trunk1] quit
2、LACP链路聚合
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] interface eth-trunk 1 //创建ID为1的Eth-Trunk接口
[SwitchA-Eth-Trunk1] mode lacp //配置链路聚合模式为LACP模式
[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
[SwitchA] lacp priority 100 //系统LACP优先级缺省为32768,修改SwitchA的优先级大于SwitchB的优先级,作为主动端
[SwitchA] interface eth-trunk 1
[SwitchA-Eth-Trunk1] max active-linknumber 2 //链路聚合组活动接口数的上限阈值缺省是8,修改活动接口数的上限阈值为2
[SwitchA-Eth-Trunk1]lacp preempt enable //开启LACP抢占模式(选配)
[SwitchA-Eth-Trunk1]lacp preempt delay 40 //LACP抢占时间为40s(选配)
[SwitchA-Eth-Trunk1]lacp timeout slow //设置LACP的接收超时时间(选配)
[SwitchA-Eth-Trunk1] quit
[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