配置手工模式eth-trunk
[SW1]interface eth-trunk 1 //创建并进入 eth-trunk 1
[SW1-Eth-Trunk1]mode manual load-balance //配置手工模式
[SW1-Eth-Trunk1]trunkport g0/0/5 //加入成员端口 (g 0/0/0 to 0/0/0)
[SW1-Eth-Trunk1]trunkport g0/0/6 //加入成员端口
[SW1-Eth-Trunk1]port link-type trunk //配置 eth-trunk 类型为 trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20 //允许 vlan10和vlan20
<SW1>display eth-trunk 1 //查看链路聚合信息
配置lacp模式eth-trunk
[SW1]interface eth-trunk 1 //创建链路聚合组1
[SW1-Eth-Trunk1]mode lacp-static //链路聚合的工作模式是lacp
[SW1-Eth-Trunk1]trunkport g 0/0/5 to 0/0/7 //在链路聚合组中添加成员接口
[SW1-Eth-Trunk1]port link-type trunk //设置trunk模式
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20 //允许vlan10 20 流量通过
[SW1-Eth-Trunk1]max active-linknumber 2 //设置活动端口的上限阈值为2
[SW1-Eth-Trunk1]lacp preempt enable //开启链路聚合的抢占模式(默认没开启)
[HX-SW5]lacp priority 100 //设置本交换机为主动段
[HX-SW5-GigabitEthernet0/0/22]lacp priority 100 //接口设置lacp抢占模式,链路活跃
<HX-SW5>display eth-trunk 1 //查看链路聚合接口状态(活跃非活跃)
注:
[SW1-Eth-Trunk1]lacp preempt enable //开启抢占功能
[SW1-Eth-Trunk1]lacp preempt delay 10 //配置抢占延迟时间为10秒