用交叉网线分别把C 2950A 交换机的FastEthernetO/23、24端口和C2950B交换机的FastEthernet0/23、24端口连接起来。
图1 交换机的Etherchannel连接
手动配置EtherChannel
⑴ 创建EtherChannel:
C 2950A (config)#interface port-channel 3
⑵ 将物理接口指定到通道中:
C 2950A (config)# interface fa0/23
C 2950A (config-if)#channel-group 3 mode on
此时交换机显示:
00:21:06: %EC-5-BUNDLE: Interface Fa0/23 joined port-channel Po3
00:21:08: %LINK-3-UPDOWN: Interface Port-channel3, changed state to up
00:21:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel3, changed state to up
C 2950A (config-if)# interface fa0/24
C 2950A (config-if)# channel-group 3 mode on
00:21:26: %EC-5-BUNDLE: Interface Fa0/24 joined port-channel Po3
⑶ 在以太通道上启用Trunking:
C 2950A (config)#interface port-channel 3
C 2950A (config-if)#switchport mode trunk
⑷ 监测EtherChannel的状态:
①C 2950A # show etherchannel 3 summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - port-channel in use
Group Port-channel Ports
-------+--------------+------------------------------------------------
2 Po2(SU) Fa0/23(P) Fa0/24(P)
②C 2950A #show etherchannel 3 brief
Group state = L2
Ports: 2 Maxports = 8
Port-channels: 1 Max Port-channels = 1
自动配置EtherChannel
⑴ C 2950A (config)#interface fa0/23
C 2950A (config-if)#channel-group 2 mode desirable
C 2950A (config-if)#switchport mode trunk
此时交换机显示:
Creating a port-channel interface Port-channel2
⑵ C 2950A (config-if)# interface fa0/24
C 2950A (config-if)# channel-group 2 mode desirable
C 2950A (config-if)#switchport mode trunk
此时交换机无显示!
⑶ 用show etherchannel 2 summary可以看到channel已存在,但显示接口和Port-channel都处于Down状态。
C 2950A #show etherchannel 2 summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - port-channel in use
Group Port-channel Ports
--------+--------------------+-----------------------------------------------------------
2 Po2(SD) Fa0/23(D) Fa0/24(D)
⑷ 用show running-config显示发现接口23、24均处于关闭状态,用no shutdown命令将接口打开:
C 2950A (config)#int fa0/23
C 2950A (config-if)#no shut
00:39:38: %LINK-3-UPDOWN: Interface FastEthernet0/23, changed state to up
00:39:40: %LINK-3-UPDOWN: Interface FastEthernet0/23, changed state to up
00:39:41: %DTP-5-TRUNKPORTON: Port Fa0/23 has become dot1q trunk
00:39:43: %EC-5-BUNDLE: Interface Fa0/23 joined port-channel Po2
00:39:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
00:39:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to up
00:39:45: %LINK-3-UPDOWN: Interface Port-channel2, changed state to up
00:39:46: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel2, changed state to up
C 2950A (config)#int fa0/24
C 2950A (config-if)#no shut
00:40:23: %LINK-3-UPDOWN: Interface FastEthernet0/24, changed state to up
00:40:27: %DTP-5-TRUNKPORTON: Port Fa0/24 has become dot1q trunk
00:40:28: %EC-5-BUNDLE: Interface Fa0/24 joined port-channel Po2
00:40:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
可以看到EtherChannel和Trunk都起来了。
【问题】:为什么自动配置时,接口必须用no shutdown命令打开后EtherChannel和Trunk才能起来,而手动配置时不需要?
第3步:取消EtherChannel
⑴ 分别将端口从EtherChannel中退出:
C2950B(config)#int fa0/23
C2950B(config-if)#no channel-group 3 mode on
00:47:50: %EC-5-UNBUNDLE: Interface Fa0/23 left the port-channel Po3
C2950B(config-if)#int fa0/24
C2950B(config-if)#no channel-group 3 mode on
00:48:10: %EC-5-UNBUNDLE: Interface Fa0/24 left the port-channel Po3
00:48:11: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel3, changed state to down
00:48:24: %SYS-5-CONFIG_I: Configured from console by console
00:48:57: %DTP-5-NONTRUNKPORTON: Port Fa0/23-Fa0/24 has become non-trunk
00:48:57: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
00:48:57: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
⑵ 直接取消EtherChannel:
C 2950A (config)#no interface port-channel 3
00:31:11: %EC-5-UNBUNDLE: Interface Fa0/23 left the port-channel Po3
00:31:11: %EC-5-UNBUNDLE: Interface Fa0/24 left the port-channel Po3
00:31:12: %DTP-5-NONTRUNKPORTON: Port Fa0/23-Fa0/24 has become non-trunk
00:31:12: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
00:31:13: %LINK-5-CHANGED: Interface FastEthernet0/23, changed state to administratively down
00:31:13: %LINK-5-CHANGED: Interface FastEthernet0/24, changed state to administratively down
00:31:14: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
00:31:14: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down