1.交换机创建聚合组,并加入接口。两台交换机配置基本一致。
#关闭终端消息提示,建议关闭,配置过程中可能会提示很多消息
<SW2>undo terminal monitor
<SW2>system
#创建二层聚合接口,并进入二层聚合接口视图
[SW2]interface bridge-aggregation 1
[SW2-Bridge-Aggregation1]quit
#进入接口千兆接口1/0/1至1/0/3
[SW2]interface range gigabitethernet 1/0/1 to gigabitethernet 1/0/3
#将接口加入聚合组
[[SW2-if-range]port link-aggregation group 1
[SW2-if-range]quit
[SW2]interface bridge-aggregation 1
#配置聚合组接口为Trunk类型
[SW2-Bridge-Aggregation1]port link-type trunk
#配置聚合组工作在动态聚合模式
[SW2-Bridge-Aggregation1]link-aggregation mode dynamic
[SW2-Bridge-Aggregation1]quit
2.创建VLAN
#交换机SW1
#创建VLAN 10 20 ,并将相应接口加入VLAN
[SW1]vlan 10 20
[SW1]interface gigabitethernet 1/0/4
[SW1-GigabitEthernet1/0/4]port link-type access
[SW1-GigabitEthernet1/0/4]port access vlan 10
[SW1-GigabitEthernet1/0/4]interface gigabitethernet 1/0/5
[SW1-GigabitEthernet1/0/5]port link-type access
[SW1-GigabitEthernet1/0/5]port access vlan 20
#在聚合组内放行VLAN 10 20
[SW1]interface bridge-aggregation 1
[SW1-Bridge-Aggregation1]port trunk permit vlan 10 20
[SW1-Bridge-Aggregation1]quit
[SW1]save force
#交换机SW2
#创建VLAN 10 20 ,并将相应接口加入VLAN
[SW2]vlan 10 20
[SW2]interface gigabitethernet 1/0/4
[SW2-GigabitEthernet1/0/4]port link-type access
[SW2-GigabitEthernet1/0/4]port access vlan 10
[SW2-GigabitEthernet1/0/4]interface gigabitethernet 1/0/5
[SW2-GigabitEthernet1/0/5]port link-type access
[SW2-GigabitEthernet1/0/5]port access vlan 20
#在聚合组内放行VLAN 10 20
[SW2-GigabitEthernet1/0/5]interface bridge-aggregation 1
[SW2-Bridge-Aggregation1]port trunk permit vlan 10 20
[SW2-Bridge-Aggregation1]quit
3.测试
查看聚合组信息,接口均在选中(S)状态。
同VLAN设备可正常通信。