本文档提供 Catalyst 3524XL 和 Catalyst 2950 交换机之间的 IEEE 802.1Q 中继以及 EtherChannel 的示例配置。执行命令时,每个命令的结果都将显示出来。任何 Catalyst 第 2 层固定配置交换机(包括 2900XL/3500XL、2940、2950/2955 和 2970)都可以通过本文档中提供的方案获得同样的结果。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
在本文档中,每台交换机的 4 个快速以太网端口已设置为 802.1Q 中继端口,并捆绑到一个快速以太信道 (FEC)。
为了创建本文档中的示例,我们在实验室环境下使用了采用原始配置的以下交换机:
运行 Cisco IOS® 软件版本 12.0(5.2)XU 的 Catalyst 3524XL 交换机
运行 Cisco IOS 软件版本 12.1(6)EA2a 的 Catalyst 2950 交换机
不需要使用连续端口,形成这些交换机上的FEC。
采用运行 Cisco IOS 软件版本 11.2(8)SA1 或 11.2(8)SA2 的 Catalyst 2900XL 时,每个交换机允许使用四个 FEC(端口组),每个组允许包含无数量限制的端口。信道中链路间的负载均衡始终基于目标 MAC 地址进行。作为同一 portchannel 的成员的所有端口必须具有相同的配置。它们需要传输同一组VLAN,并像运行的中继线状态一样,都必须有Trunk或非Trunk。Switched Port Analyzer (SPAN) 和端口安全功能不受支持。
在运行 Cisco IOS 软件版本 11.2(8)SA3 或更高版本的 Catalyst 2900XL、运行 Cisco IOS 软件版本 11.2(8)SA6 或更高版本的 Catalyst 3500XL 以及 Catalyst 2950/2955 上,信道中链路间的负载均衡可配置为基于源或目标 MAC 地址进行(默认基于源地址)。基于源的转发允许一个 FEC(端口组)最多有 8 个端口。 基于目标的转发允许每个端口组的端口数目不受限制。每个交换机最多可以配置 12 个 FEC 端口组,并且可以混合使用基于源/基于目标的组。作为同一 portchannel 的成员的所有端口必须具有相同的配置。它们需要传输同一组VLAN,并像运行的中继线状态一样,都必须有Trunk或非Trunk。SPAN 和端口安全不受支持。
Catalyst 2940 和 2950/2955 交换机只支持 802.1Q 中继,不支持交换机间链路协议 (ISL) 中继。Catalyst 2970 同时支持 802.1Q 和 ISL 中继协议。
有几种创建中继的方法。如果端口能成为Trunk,它也能够自动建立中继,甚至在某些情况下协商端口上使用的Trunking类型。这种与其他设备协商中继方法的能力称为动态中继协议 (DTP)。
注意:Catalyst 2900XL/3500XL交换机不支持DTP。Catalyst 2950/2955 交换机支持 DTP,可与 Cisco IOS 软件版本 12.1(6)EA2 或更高版本动态中继。Catalyst 2940 和 2970 在所有 Cisco IOS 软件版本中都支持 DTP。
Port Aggregation Protocol (PAgP) 有助于自动创建 FECl 链路。为了协商形成信道,PAgP信息包在支持FECL的端口之间发送。在 PAgP 中有意引入了一些限制。限制如下:
PAgP 不能在为动态 VLAN 配置的端口上构建链路捆绑。PAgP 要求信道中的所有端口均属于同一 VLAN 或均配置为中继端口。如果已存在一个链路捆绑,并要修改其中某一端口的 VLAN,则将修改该链路捆绑中的所有端口以匹配该 VLAN。
PAgP 不会对以不同速度或端口双工运行的端口进行分组。如果在存在链路捆绑的情况下更改速度和双工,PAgP 会更改链路捆绑中所有端口的速度和双工。
PAgP 模式包括 off、auto、desirable 和 on。只有结合使用auto-desirable、desirable-desirable和on-on,才允许信道形成。
对 PAgP 模式的解释如下。
在:PAgP 不运行。信道强制启动。
off:PAgP 不运行。信道强制保持 down。
自动:PAgP 被动运行。需要形成信道;但未启动该操作。
desirable:PAgP 主动运行。需要形成信道,并启动该操作。
只有结合使用auto-desirable、desirable-desirable和on-on,才允许信道形成。如果信道某一端的设备不支持PAgP(如路由器),其他端的设备必须将PAgP设置为开。
注意:Catalyst 2900XL/3500XL交换机不支持PAgP。Catalyst 2950/2955 交换机支持 PagP,可与 Cisco IOS 软件版本 12.1(6)EA2 或更高版本进行信道协商;Cisco IOS 软件版本 12.0 只支持静态配置。Catalyst 2940 和 2970 在所有 Cisco IOS 软件版本中都支持 PAgP。
链路聚合控制协议 (LACP) 中继支持四种操作模式:
开启:强制形成链路聚合而不进行任何LACP协商。换句话说,交换机既不发送LACP数据包,也不处理任何入站LACP数据包。这类似于 PAgP 的打开状态。
关闭:不形成链路聚合。既不发送也不识别 LACP 数据包。这类似于 PAgP 的关闭状态。
被动:交换机不启动信道,但可以识别入站 LACP 数据包。对等交换机(处于活动状态)启动协商(当它发出 LACP 数据包时),我们接收并进行回复,最终与对等交换机形成聚合信道。这类似于 PAgP 中的 auto 模式。
活动:我们可以形成聚合链路并启动协商。如果另一端以 LACP active 或 passive 模式运行,则形成链路聚合。这类似于 PAgP 的 desirable mode。
注意:默认情况下,配置LACP通道时,LACP通道模式为被动。
注意:Catalyst 2900XL/3500XL交换机不支持LACP。Catalyst 2950/2955 交换机支持 LACP,可与 Cisco IOS 软件版本 12.1(6)EA2 或更高版本进行信道协商。Cisco IOS 软件版本 12.0 只支持静态配置。Catalyst 2940 和 2970 在所有 Cisco IOS 软件版本中都支持 LACP。
本文档使用下图所示的网络设置。
本文档使用如下所示的配置。
Catalyst 3524 XL |
---|
Comments between the outputs are added in blue italics for explanation. Flush#show run Building configuration... Current configuration: ! version 12.0 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Flush ! ! ip subnet-zero ! !--- Since the 2900XL/3500XL switches do not support !--- dynamic channel negotiation, verify the !--- configuration before enabling secondary links. !--- You may see a loop before the configuration is finished if !--- both ports are connected while doing changes. !--- Shut down the ports involved in the channel first. When the !--- configuration is complete, enable them back. !--- An example of a brief loop is shown below. !--- flush# !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. !--- 6d12h: %RTD-1-ADDR_FLAP: FastEthernet0/3 relearning five addresses per minute. !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. !--- 6d12h: %RTD-1-ADDR_FLAP: FastEthernet0/24 relearning eight addresses per minute. !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. ! ! interface FastEthernet0/1 port group 1 !--- Assigned port to port channel 1. switchport trunk encapsulation dot1q !--- Configured the port to use the trunking encapsulation dot1Q. switchport mode trunk !--- Configured port to be in trunking mode. ! interface FastEthernet0/2 port group 1 !--- Assigned port to port channel 1. switchport trunk encapsulation dot1q switchport mode trunk ! interface FastEthernet0/3 port group 1 !--- Assigned port to port channel 1. switchport trunk encapsulation dot1q switchport mode trunk ! interface FastEthernet0/4 port group 1 !--- Assigned port to port channel 1. switchport trunk encapsulation dot1q switchport mode trunk ......(output Suppressed) ! interface VLAN1 ip address 1.1.1.2 255.255.255.0 no ip directed-broadcast no ip route-cache ! line con 0 transport input none stopbits 1 line vty 0 4 login line vty 5 15 login |
Catalyst 2950 |
---|
Comments between the outputs are added in blue italics for explanation. Hanka>en Hanka#show run Building configuration... Current configuration : 1298 bytes ! version 12.1 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Hanka ! ! ip subnet-zero ! interface Port-channel1 flowcontrol send off switchport mode trunk !--- Since the 2900XL/3500XL series switches do not !--- support dynamic channel negotiation, !--- verify the configuration before !--- enabling secondary links. !--- You may see a loop before the configuration is !--- finished if both ports are connected while doing changes. !--- We suggest shutting down the ports involved in the channel !--- first, and when the configuration is complete, !--- enabling them back. !--- An example of a brief loop is shown below. !--- flush# !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. !--- 6d12h: %RTD-1-ADDR_FLAP: FastEthernet0/3 relearning five addresses per minute. !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. !--- 6d12h: %RTD-1-ADDR_FLAP: FastEthernet0/24 relearning eight addresses per minute. !--- 6d12h: %LINK-4-ERROR: FastEthernet0/1 is experiencing errors. ! interface FastEthernet0/1 switchport mode trunk !--- Configured port to be in trunking mode. channel-group 1 mode on !--- Assigned port to port channel 1. !--- Catalyst 2950/2955 switches only support 802.1Q encapsulation, !--- which is configured automatically !--- when trunking is enabled on the interface by !--- issuing the switchport mode trunk command. !--- Note: The channel-group command is introduced in !--- Cisco IOS Software Release 12.1. Cisco IOS Software Release 12.0 has !--- the port group command to configure channeling. ! interface FastEthernet0/2 switchport mode trunk channel-group 1 mode on !--- Assigned port to port channel 1. ! interface FastEthernet0/3 switchport mode trunk channel-group 1 mode on !--- Assigned port to port channel 1. ! interface FastEthernet0/4 switchport mode trunk channel-group 1 mode on !--- Assigned port to port channel 1. ......(output Suppressed) interface Vlan1 ip address 1.1.1.1 255.255.255.0 no ip route-cache ! ip http server ! line con 0 transport input none line vty 0 4 login line vty 5 15 login ! end |
本部分所提供的信息可用于确认您的配置是否正常工作。
show CDP neighbor Flush#show cdp neighbor Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID Local Intrfce Holdtme Capability Platform Port ID Hanka Fas 0/4 173 S I WS-C2950T-Fas 0/4 Hanka Fas 0/3 173 S I WS-C2950T-Fas 0/3 Hanka Fas 0/2 173 S I WS-C2950T-Fas 0/2 Hanka Fas 0/1 173 S I WS-C2950T-Fas 0/1 Flush# show port group Flush>en Flush#show port group Group Interface Transmit Distribution ----- --------------------- --------------------- 1 FastEthernet0/1 source address 1 FastEthernet0/2 source address 1 FastEthernet0/3 source address 1 FastEthernet0/4 source address show spanning-tree Flush#show spanning-tree Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol Bridge Identifier has priority 32768, address 0001.4264.82c0 Configured hello time 2, max age 20, forward delay 15 We are the root of the spanning tree Topology change flag not set, detected flag not set, changes 2 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0 Interface Fa0/1 (port 1) in Spanning tree 1 is FORWARDING Port path cost 8, Port priority 128 Designated root has priority 32768, address 0001.4264.82c0 Designated bridge has priority 32768, address 0001.4264.82c0 Designated port is 1, path cost 0 Timers: message age 0, forward delay 0, hold 0 BPDU: sent 41527, received 231 Interface Fa0/5 (port 17) in Spanning tree 1 is down Port path cost 100, Port priority 128
注意:接口Fa0/2 — 接口Fa0/4未显示在输出中,因为它们与端口通道中的Fa0/1捆绑在一起。
show interface x/x switchport Flush#show interface fast 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: Disabled Access Mode VLAN: 0 ((Inactive)) Trunking Native Mode VLAN: 1 (default) Trunking VLANs Enabled: ALL Trunking VLANs Active: 1,2 Pruning VLANs Enabled: 2-1001 Priority for untagged frames: 0 Override vlan tag priority: FALSE Voice VLAN: none Appliance trust: none Flush#show interface fast 0/2 switchport Name: Fa0/2 Switchport: Enabled Administrative mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: Disabled Access Mode VLAN: 0 ((Inactive)) Trunking Native Mode VLAN: 1 (default) Trunking VLANs Enabled: ALL Trunking VLANs Active: 1,2 Pruning VLANs Enabled: 2-1001 Priority for untagged frames: 0 Override vlan tag priority: FALSE Voice VLAN: none Appliance trust: none Flush#
show CDP neighbor Hanka#show cdp neighbor Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID Local Intrfce Holdtme Capability Platform Port ID Flush Fas 0/4 127 T S WS-C3524-XFas 0/4 Flush Fas 0/3 127 T S WS-C3524-XFas 0/3 Flush Fas 0/2 127 T S WS-C3524-XFas 0/2 Flush Fas 0/1 127 T S WS-C3524-XFas 0/1 Hanka# show etherchannel
注意:此命令最初在Cisco IOS软件版本12.1(6)EA2中引入。它取代了show port group命令。
Hanka#show etherchannel port-channel Channel-group listing: ----------------------- Group: 1 ---------- Port-channels in the group: ---------------------- Port-channel: Po1 ------------ Age of the Port-channel = 00d:23h:06m:07s Logical slot/port = 1/0 Number of ports = 4 GC = 0x00010001 HotStandBy port = null Port state = Port-channel Ag-Inuse Ports in the Port-channel: Index Load Port EC state ------+------+------+------------ 0 00 Fa0/1 on 0 00 Fa0/2 on 0 00 Fa0/3 on 0 00 Fa0/4 on Time since last port bundled: 00d:23h:05m:46s Fa0/4 show spanning-tree Hanka#show spanning-tree Port 65 (Port-channel1) of VLAN1 is forwarding Port path cost 8, Port priority 128, Port Identifier 128.65. Designated root has priority 32768, address 0001.4264.82c0 Designated bridge has priority 32768, address 0001.4264.82c0 Designated port id is 128.1, designated path cost 0 Timers: message age 2, forward delay 0, hold 0 Number of transitions to forwarding state: 1 BPDU: sent 5, received 41627 show interfaces trunk
注意:此命令最初在Cisco IOS软件版本12.1(6)EA2中引入。
Hanka#show interfaces trunk Port Mode Encapsulation Status Native vlan Po1 on 802.1Q trunking 1 Port Vlans allowed on trunk Po1 1-1005 Port Vlans allowed and active in management domain Po1 1-2,999 Port Vlans in spanning tree forwarding state and not pruned Po1 1-2,999 Hanka#
目前没有针对此配置的故障排除信息。