huawei--配置链路聚合
项目要求:
LSW1和LSW2之间配置链路聚合,链路聚合分为手工和lacp两种模式。配置完后查看链路聚合状态。
项目实施:
(vlan10 20 30的创建命令vlan batch 10 20 30)
1、创建链路聚合组
LSW1
[SW1]interface Eth-Trunk 1
LSW2
[SW2]interface Eth-Trunk 1
2、端口加入链路聚合组
LSW1
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/5
LSW2
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/5
3、配置链路聚合组的传输模式为trunk
LSW1
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20 30
LSW2
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20 30
4、配置完后查看链路聚合状态
LSW1
LSW2
5、因为手工聚合没有冗余,修改成静态聚合。(修改前把trunk模式和接口去掉)
LSW1
[SW1]interface Eth-Trunk 1
[SW1-Eth-Trunk1]undo port tr al vlan 10 20 30
[SW1-Eth-Trunk1]undo port link-type
[SW1-Eth-Trunk1]undo trunkport GigabitEthernet 0/0/3 to 0/0/5
[SW1-Eth-Trunk1]mode lacp-static
LSW2
[SW2]interface Eth-Trunk 1
[SW2-Eth-Trunk1]undo port tr al vlan 10 20 30
[SW2-Eth-Trunk1]undo port link-type
[SW2-Eth-Trunk1]undo trunkport GigabitEthernet 0/0/3 to 0/0/5
[SW2-Eth-Trunk1]mode lacp-static
6、接口重新加入链路聚合组,并配置链路聚合组的传输模式为trunk
LSW1
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/5
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20 30
LSW2
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/5
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20 30
7、激活链路,并开启抢占模式
LSW1
[SW1-Eth-Trunk1]max active-linknumber 2
[SW1-Eth-Trunk1]lacp preempt enable
LSW2
[SW2-Eth-Trunk1]max active-linknumber 2
[SW2-Eth-Trunk1]lacp preempt enable
8、配置抢占时间(单位:秒),设置优先级使LSW1变成主设备(优先级默认是:32768,值越小优先级越高。)
LSW1
[SW1-Eth-Trunk1]lacp preempt delay 10
[SW1]lacp priority 32760 (优先级)
LSW2
[SW1-Eth-Trunk1]lacp preempt delay 10
9、配置完后查看链路聚合状态
LSW1
LSW2