本文提供設定EtherChannel連結的範例組態和命令結構,EtherChannel連結是Catalyst第2層(L2)固定組態交換器(包括2950/2955/2970/2940/2900XL/3500XL交換器)和執行Catalyst OS(CatOS)的Catalyst 4500/4000交換器之間的主干連結。 在此案例中,您可以使用執行CatOS的任何Catalyst 4500/4000、5500/5000或6500/6000系列交換器設定Catalyst L2固定組態交換器,以取得相同的結果。隨著快速乙太網在當前網路中的普及,示例配置使用快速乙太網。該示例將每台交換機的兩個快速乙太網埠捆綁到一個快速EtherChannel(FEC)中,並在FEC頂部配置IEEE 802.1Q(dot1q)中繼。
本文使用相同的術語EtherChannel來指代FEC、Gigabit EtherChannel(GEC)、連線埠通道、通道和連線埠群組。有關如何配置交換機上的EtherChannel的詳細資訊,請參閱以下文檔:
在Catalyst 4000交換器上設定快速EtherChannel和Gigabit EtherChannel
Catalyst 2950交換器上設定EtherChannel
Catalyst 2950/2955交換器上設定EtherChannel
Catalyst 2970交換器上設定EtherChannel
Catalyst 2940交換器上設定EtherChannel
本文中的資訊係根據以下軟體和硬體版本:
執行Cisco IOS®軟體版本12.1(6)EA2c的Catalyst 2950
執行Cisco IOS軟體版本12.1(12c)EA1的Catalyst 2955
執行Cisco IOS軟體版本12.1(22)EA1的Catalyst 2940
執行Cisco IOS軟體版本12.1(19)EA1c的Catalyst 2970
執行Cisco IOS軟體版本12.0(5)WC9的Catalyst 2900XL/3500XL
執行CatOS版本8.4.1的Catalyst 4000
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
使用Catalyst L2固定組態交換器和執行CatOS的任何Catalyst 4500/4000系列產品(Catalyst 4003/4006/2948G/2980G)時,請記住,交換器僅支援dot1q中繼封裝。其他Catalyst平台同時支援dot1q和交換器間連結通訊協定(ISL)。 雖然dot1q是IEEE標準,但ISL是Cisco專有協定。只有Cisco硬體能夠支援ISL中繼封裝。如果您使用其他Cisco交換平台(例如Catalyst 5500/5000或Catalyst 6500/6000),並需要判斷哪個中繼方法具有支援,請發出以下命令:
show port capabilities mod/port
如需特定連線埠的詳細資訊,以及特定連線埠具有的功能(例如dot1q、ISL和連線埠通道),請參閱:
EtherChannel可自動設定為連線埠彙總通訊協定(PAgP)或連結彙總控制通訊協定(LACP)。 您也可以手動設定EtherChannel。PAgP是思科專有協定,您只能在思科交換機和授權供應商許可支援PAgP的交換機上運行。IEEE 802.3ad定義了LACP。LACP允許思科交換機管理符合802.3ad協定的交換機之間的乙太網通道。最多可配置16個埠以形成通道。其中8個埠處於主用模式,另外8個埠處於備用模式。當任何活動埠發生故障時,備用埠變為活動狀態。備用模式僅適用於LACP,不適用於PAgP。
如果您使用其中一種協定,交換機將獲知能夠支援PAgP或LACP的合作夥伴身份並獲知每個介面的功能。然後,交換機將具有相似配置的介面動態分組到單個邏輯鏈路(通道或聚合埠);交換機將這些介面組基於硬體、管理和埠引數限制。例如,PAgP使用相同的速度、雙工模式、本徵VLAN、VLAN範圍以及中繼狀態和型別對介面進行分組。PAgP將鏈路分組到EtherChannel後,PAgP會將該組作為單個交換機埠新增到生成樹中。
交換器 | LACP支援 | 支援的最低LACP版本 | PAgP支援 | 含支援的最低PAgP版本 |
---|---|---|---|---|
Catalyst 2940 | 是 | Cisco IOS軟體版本12.1(19)EA1 | 是 | Cisco IOS軟體版本12.1(13)AY |
Catalyst 2950 | 是 | Cisco IOS軟體版本12.1(14)EA1 | 是 | Cisco IOS軟體版本12.0(5.2)WC(1) |
Catalyst 2955 | 是 | Cisco IOS軟體版本12.1(14)EA1 | 是 | Cisco IOS 軟體版本 12.1(12c)EA1 |
Catalyst 2970 | 是 | Cisco IOS軟體版本12.2(18)SE | 是 | Cisco IOS軟體版本12.1(11)AX |
Catalyst 2900XL | 否 | — | 否 | — |
Catalyst 3500XL | 否 | — | 否 | — |
本節列出channel-group介面組態指令的使用者可設定的EtherChannel模式。交換機介面僅與具有auto或desirable模式配置的夥伴介面交換PAgP資料包。交換機介面僅與具有主用模式或被動模式配置的夥伴介面交換LACP資料包。具有on模式配置的介面不會交換PAgP或LACP資料包。
active — 將介面置於主動協商狀態,在該狀態下,介面通過傳送LACP資料包開始與其他介面的協商。
auto — 將介面置於被動協商狀態,在該狀態下,介面將響應介面接收到的PAgP資料包,但不會啟動PAgP資料包協商。此設定可將PAgP資料包的傳輸降至最低。
desirable — 將介面置於主動協商狀態,在該狀態下,介面通過傳送PAgP資料包開始與其他介面協商。
on — 強制介面進入不帶PAgP或LACP的EtherChannel。若使用on模式,則只有在on模式的介面群組具有與on模式中的另一個介面群組的連線時,才存在可用的EtherChannel。
passive — 將介面置於被動協商狀態,在該狀態下,介面將響應介面收到的LACP資料包,但不啟動LACP資料包協商。此設定可將LACP資料包的傳輸降至最低。
只有三個有效組合可以運行LACP鏈路聚合,如下表所示:
交換器 | 交換器 | 意見 |
---|---|---|
active(作用中) | active(作用中) | 建議。 |
active(作用中) | 被動 | 如果協商成功,則會發生鏈路聚合。 |
於 | 於 | 鏈路聚合不使用LACP。雖然這樣有效,但不建議使用此組合。 |
注意:預設情況下,配置LACP通道時,LACP通道模式是被動的。
PAgP有助於自動建立FEC連結。PAgP資料包在支援FEC的埠之間傳輸以協商通道的形成。PAgP中特意引入了一些限制。限制如下:
PAgP不會在具備動態VLAN配置的埠上形成捆綁包。PAgP要求通道中的所有埠屬於同一個VLAN,或者這些埠具有中繼埠配置。當捆綁包已存在並且您修改了埠的VLAN時,捆綁包中的所有埠都會更改以匹配該VLAN。
PAgP不對以不同速度或埠雙工運行的埠進行分組。如果當套件組合存在時變更速度和雙工,PAgP會變更套件組合中所有連線埠的連線埠速度和雙工。
PAgP模式為off、auto、desirable和on。只有auto-desirable、desirable-desirable和on-on組合才允許形成通道。如果通道一端的裝置(例如路由器)不支援PAgP,則另一端的裝置必須將PAgP設定為on。Catalyst 2950交換器支援PAgP,以便與Cisco IOS軟體版本12.1(6)EA2或更新版本進行通道交涉。Cisco IOS軟體版本12.0僅支援靜態配置。所有執行CatOS的Catalyst交換器支援PAgP通訊協定通道交涉。
中繼協定有多種型別。如果埠可以成為中繼,它還可以自動中繼埠。在某些情況下,埠甚至可以協商要在埠上使用的中繼型別。這種與另一台裝置協商中繼方法的能力名為動態中繼協定(DTP)。
Catalyst 2950交換器使用Cisco IOS軟體版本12.1(6)EA2或更新版本支援動態中繼的DTP。Cisco IOS軟體版本12.0僅支援靜態配置。所有執行CatOS的Catalyst交換器支援DTP。
本節提供用於設定本文件中所述功能的資訊。
注意:要查詢有關本文檔中使用的命令的其他資訊,請使用命令查詢工具 (僅限註冊客戶)。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
Catalyst 4000 |
---|
Cat4003 (enable) show channelprotocol Channel Module Protocol ------- -------- 2 PAGP Cat4003 (enable) !--- By default, all ports on a Catalyst 4500/4000 use channel protocol PAgP. !--- So, to run LACP, you must change the channel protocol to LACP. On switches !--- that run CatOS, you can only change the channel mode per module. In this !--- example, the command set channelprotocol lacp module_number !--- changes the channel mode for slot 2. Use the show channelprotocol command to !--- verify the changes. Cat4003 (enable) set channelprotocol lacp 2 Mod 2 is set to LACP protocol. Cat4003 (enable) Cat4003 (enable) set port lacp-channel 2/1-2 Port(s) 2/1-2 are assigned to admin key 80. Cat4003 (enable) !--- There is a parameter exchange in the LACP packet. The parameter is !--- the admin key. A channel can only form between ports that have !--- the same admin key. In this example, both ports have assignment to the same group. !--- (The random assignment is admin key 80.) !--- Keep in mind that the admin key is only locally significant. In other words, !--- the admin key must be the same only for ports within the switch and is not a factor !--- between different switches. Cat4003 (enable) set port lacp-channel 2/1-2 mode active Port(s) 2/1-2 channel mode set to active. Cat4003 (enable) To form the channel change the LACP channel mode to active state on one or both of the sides. Cat4003 (enable) set trunk 2/1 desirable dot1q Port(s) 2/1-2 trunk mode set to desirable. Port(s) 2/1-2 trunk type set to dot1q. Cat4003 (enable) !--- Configure the ports to the desirable trunk mode that makes the ports actively !--- attempt to convert the link to a trunk link. The ports become trunk ports if !--- the neighbor ports are in on, desirable, or auto mode. Cat4003 (enable) show config This command shows non-default configurations only. Use 'show config all' to show both default and non-default configurations. ................. ............................. .. begin !--- Output suppressed. #channelprotocol set channelprotocol lacp 2 ! #port channel set port lacp-channel 2/1-2 80 ! !--- Output suppressed. #module 2 : 48-port 10/100/1000 Ethernet set trunk 2/1 desirable dot1q 1-1005,1025-4094 set trunk 2/2 desirable dot1q 1-1005,1025-4094 ! !--- Output suppressed. |
Catalyst L2固定組態交換器平台的設定命令相同。為使檔案長度保持合理,本檔案只會顯示其中一個平台(Catalyst 2955)的組態。 但是,在所有Catalyst L2固定配置交換機平台上對所有命令進行了測試。
Catalyst L2固定組態交換器 |
---|
CAT2955# configure terminal Enter configuration commands, one per line. End with CNTL/Z. CAT2955(config)# interface fastethernet 0/9 CAT2955(config-if)# channel-group 1 mode active Creating a port-channel interface Port-channel 1 Assign the interface to a channel group, and specify the LACP mode. CAT2955(config-if)# 6d08h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9,changed state to down 6d08h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9,changed state to up 6d08h: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up 6d08h: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1,changed state to up CAT2955(config-if)# interface fastethernet 0/10 CAT2955(config-if)# channel-group 1 mode active CAT2955(config-if)# 6d08h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10,changed state to down 6d08h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10,changed state to up CAT2955(config-if)# interface port-channel 1 CAT2955(config-if)# switchport mode trunk Configuring the port channel interface to be a trunk pulls fa 0/9-10 in. CAT2955(config-if)# ^Z CAT2955# show run 6d08h: %SYS-5-CONFIG_I: Configured from console by consolerun Building configuration... !--- Output suppressed. ! interface Port-channel1 switchport mode trunk no ip address flowcontrol send off fcs-threshold 0 ! !--- Output suppressed. interface FastEthernet0/9 switchport mode trunk no ip address channel-group 1 mode active ! interface FastEthernet0/10 switchport mode trunk no ip address channel-group 1 mode active ! !--- Output suppressed. end CAT2955# |
Catalyst L2固定組態交換器 |
---|
5-2950# configure terminal Enter configuration commands, one per line. End with CNTL/Z. 5-2950(config)# interface fastethernet0/1 5-2950(config-if)# channel-group 1 mode desirable Creating a port-channel interface Port-channel1 !--- The software dynamically creates the port channel interface. 5-2950(config-if)# *Mar 16 13:50:56.185: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down *Mar 16 13:50:57.013: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1 *Mar 16 13:50:58.053: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up *Mar 16 13:50:59.021: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up *Mar 16 13:51:00.021: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up 5-2950(config-if)# 5-2950(config)# interface fastethernet0/2 5-2950(config-if)# channel-group 1 mode desirable 5-2950(config-if)# 5-2950(config-if)# interface port-channel 1 !--- Configuration of the port channel interface to be a trunk !--- pulls in Fast Ethernet 0/1 and 0/2. 5-2950(config-if)# switchport mode trunk *Mar 14 15:31:13.428: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trunk *Mar 14 15:31:14.880: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1 *Mar 14 15:31:14.908: %EC-5-UNBUNDLE: Interface Fa0/2 left the port-channel Po1 *Mar 14 15:31:14.944: %EC-5-BUNDLE: Interface Fa0/2 joined port-channel Po1 *Mar 14 15:31:15.908: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up 5-2950# show run Building configuration... Current configuration : 1608 bytes ! version 12.1 no service pad service timestamps debug uptime service timestamps log datetime msec localtime no service password-encryption ! hostname 5-2950 ! ! clock timezone PST -8 ip subnet-zero no ip finger no ip domain-lookup cluster enable SWITCH 0 ! ! ! interface Port-channel 1 !--- This is the port channel interface where you configure trunking that !--- the members of the channel group inherit. switchport mode trunk ! interface FastEthernet0/1 switchport mode trunk channel-group 1 mode desirable !--- Here, the channel group corresponds with interface port-channel 1. ! interface FastEthernet0/2 switchport mode trunk channel-group 1 mode desirable !--- Here, the channel group corresponds with interface port-channel 1. ! interface FastEthernet0/3 ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! |
Catalyst 4000交換器 |
---|
Console> (enable) set port channel 2/19-20 mode desirable Port(s) 2/19-20 channel mode set to desirable. Console> (enable) 2003 Jan 08 11:40:14 %PAGP-5-PORTFROMSTP:Port 2/19 left bridge port 2/19 2003 Jan 08 11:40:14 %PAGP-5-PORTFROMSTP:Port 2/20 left bridge port 2/20 2003 Jan 08 11:40:18 %PAGP-5-PORTTOSTP:Port 2/19 joined bridge port 2/19 2003 Jan 08 11:40:18 %PAGP-5-PORTTOSTP:Port 2/20 joined bridge port 2/20 Console> (enable) set trunk 2/19 desirable !--- The set of the trunk on the first port of the channel !--- dynamically trunks all channel ports. Port(s) 2/19-20 trunk mode set to desirable. ! Console> (enable) !--- The dot1q trunk adopts the port VLAN assignment (VLAN 1 by default) !--- as the native VLAN. If this switch were a Catalyst 5500/5000 or 6500/6000 switch !--- (which also supports ISL trunking), you would specify dot1q encapsulation here. !--- The Catalyst 2950 only supports dot1q. |
本節提供的資訊可用於確認您的組態是否正常運作。
Output Interpreter Tool (僅供註冊客戶使用)支援某些show命令,這允許您檢視show命令輸出的分析。第2層固定組態交換器平台上的show命令相同,但輸出格式可能不同。
CAT2955# show etherchannel summary Flags: D - down P - in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 u - unsuitable for bundling U - in use f - failed to allocate aggregator d - default port Number of channel-groups in use: 1 Number of aggregators: 1 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) LACP Fa0/9(P) Fa0/10(Pd) CAT2955# CAT2955# show interfaces fastethernet 0/9 switchport Name: Fa0/9 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk (member of bundle Po1) Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative private-vlan host-association: none Administrative private-vlan mapping: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Protected: false Voice VLAN: none (Inactive) Appliance trust: none
Cat4003 (enable) show lacp Channel Id Ports ----------- ----------------------------------------------- 417 2/1-2 Cat4003 (enable) show lacp-channel 417 Channel Ports Status Channel id Mode ------- ---------------------------------------------- ---------- -------------- 417 2/1-2 connected active Cat4003 (enable) Cat4003 (enable) show trunk * - indicates vtp domain mismatch # - indicates dot1q-all-tagged enabled on the port Port Mode Encapsulation Status Native vlan -------- ----------- ------------- ------------ ----------- 2/1 desirable dot1q trunking 1 2/2 desirable dot1q trunking 1 Port Vlans allowed on trunk -------- --------------------------------------------------------------------- 2/1 1-1005,1025-4094 2/2 1-1005,1025-4094 Port Vlans allowed and active in management domain -------- --------------------------------------------------------------------- 2/1 1,10 2/2 1,10 Port Vlans in spanning tree forwarding state and not pruned -------- --------------------------------------------------------------------- 2/1 1,10 2/2 1,10 Cat4003 (enable)
5-2950# show etherchannel 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 -----+------------+----------------------------------------------------------- 1 Po6(SU) Fa0/1(P) Fa0/2(P) 5-2950# show interface fastethernet0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk (member of bundle Po6) Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) !--- This line shows that the trunk link is up. Trunking VLANs Enabled: ALL !--- This line shows that all VLANs trunk. Pruning VLANs Enabled: 2-1001 Protected: false Voice VLAN: none (Inactive) Appliance trust: none
Console> show port channel Port Status Channel Admin Ch Mode Group Id ----- ---------- -------------------- ----- ----- 2/19 connected desirable silent 174 815 2/20 connected desirable silent 174 815 ----- ---------- -------------------- ----- ----- Port Device-ID Port-ID Platform ----- ------------------------------- ------------------------- ---------------- 2/19 5-2950 Fa0/1 cisco WS-C2950-24 2/20 5-2950 Fa0/2 cisco WS-C2950-24 ----- ------------------------------- ------------------------- ---------------- Console> (enable) show trunk * - indicates vtp domain mismatch Port Mode Encapsulation Status Native vlan -------- ----------- ------------- ------------ ----------- 2/19 desirable dot1q trunking 1 2/20 desirable dot1q trunking 1 Port Vlans allowed on trunk -------- --------------------------------------------------------------------- 2/19 1-1005 2/20 1-1005 Port Vlans allowed and active in management domain -------- --------------------------------------------------------------------- 2/19 1,100,300,350,450 2/20 1,100,300,350,450 Port Vlans in spanning tree forwarding state and not pruned -------- --------------------------------------------------------------------- 2/19 1,100,300,350,450 2/20 1,100,300,350,450 Console> (enable)
目前尚無適用於此組態的具體疑難排解資訊。