第一步:正确连接网线,交换机全部恢复出厂设置,做初始配置,避免广播风暴出现
交换机A:
switch#config
switch(Config)#hostname switchA
switchA(Config)#interface vlan 1
switchA(Config-If-Vlan1)#ip address 192.168.1.11 255.255.255.0
switchA(Config-If-Vlan1)#no shutdown
switchA(Config-If-Vlan1)#exit
switchA(Config)#spanning-tree
MSTP is starting now, please wait...........
MSTP is enabled successfully.
switchA(Config)#
交换机B:
switch#config
switch(Config)#hostname switchB
switchB(Config)#interface vlan 1
switchB(Config-If-Vlan1)#ip address 192.168.1.12 255.255.255.0
switchB(Config-If-Vlan1)#no shutdown
switchB(Config-If-Vlan1)#exit
switchB(Config)#spanning-tree
MSTP is starting now, please wait...........
MSTP is enabled successfully.
switchB(Config)#
第二步:创建port group
交换机A:
switchA(Config)#port-group 1
switchA(Config)#
switchA#show port-group detail
Sorted by the ports in the group 1:
--------------------------------------------
switchA#show port-group brief
Port-group number : 1
Number of ports in port-group : 0 Maxports in port-channel = 8
Number of port-channels : 0 Max port-channels : 1
switchA#
交换机B
switchB(Config)#port-group 2
switchB(Config)#
第三步:手工生成链路聚合组(第三、四步任选其一操作)
交换机A:
switchA(Config-Port-Range)#port-group 1 mode on
switchA(Config-Port-Range)#exit
switchA#show vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- -------------------
1 default Static ENET Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/10
Ethernet0/0/11 Ethernet0/0/12
Ethernet0/0/13 Ethernet0/0/14
Ethernet0/0/15 Ethernet0/0/16
Ethernet0/0/17 Ethernet0/0/18
Ethernet0/0/19 Ethernet0/0/20
Ethernet0/0/21 Ethernet0/0/22
Ethernet0/0/23 Ethernet0/0/24
Port-Channel1
switchA# !port-channel1已经存在
交换机B:
switchB(Config)#int e 0/0/3-4
switchB(Config-Port-Range)#port-group 2 mode on
switchB(Config-Port-Range)#exit
验证配置:
switchB#show port-group brief
Port-group number : 2
Number of ports in port-group : 2 Maxports in port-channel = 8
Number of port-channels : 1 Max port-channels : 1
switchB#
第四步: LACP动态生成链路聚合组(第三、四步任选其一操作)
switchA(Conifg-Port-Range)#port-group 1 mode active
验证配置:
switchA#show vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- -------------------
1 default Static ENET Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/1
Ethernet0/0/11 Ethernet0/0/1
Ethernet0/0/13 Ethernet0/0/1
Ethernet0/0/15 Ethernet0/0/1
Ethernet0/0/17 Ethernet0/0/1
Ethernet0/0/19 Ethernet0/0/2
Ethernet0/0/21 Ethernet0/0/2
Ethernet0/0/23 Ethernet0/0/2
Port-Channel1
switchA# !port-channel1已经存在
交换机B:
switchB(Config)#interface ethernet 0/0/3-4
switchB(Conifg-Port-Range)#port-group 2 mode passive
switchB(Config)#interface port-channel 2
switchB(Config-If-Port-Channel2)#
验证配置:
switchB#show port-group brief
Port-group number : 2
Number of ports in port-group : 2 Maxports in port-channel = 8
Number of port-channels : 1 Max port-channels : 1
switchB#
第五步:使用ping命令验证
使用PC1 ping PC2
交换机A 交换机B 结果 原因
0/0/1 0/0/3 通链路聚合组连接正确
0/0/2 0/0/4
0/0/1 0/0/3 通 拔掉交换机B端口4的网线,仍然可
0/0/2 以通(需要一点时间),此时用show