本文提供執行Catalyst OS(CatOS)系統軟體的Catalyst交換器與執行Cisco IOS®系統軟體的模組化第3層(L3)交換器之間的IEEE 802.1Q主幹組態範例。執行CatOS的交換器包括Catalyst 4500/4000、5500/5000和6500/6000系列交換器。執行Cisco IOS軟體的模組化L3交換器包括Catalyst 4500/4000和Catalyst 6500/6000系列交換器。Catalyst 4000(CatOS)和Catalyst 6500(Cisco IOS軟體)的組態範例使用,但前面提到的所有交換器都可能用於達成相同的結果。
主幹連線是在兩個裝置之間,透過點對點連結,從多個 VLAN 攜帶流量的方式。實現乙太網中繼的兩種方法是:
交換器間連結通訊協定(ISL)(思科專有通訊協定)
802.1Q(IEEE標準)
有關Catalyst交換機上與802.1Q和ISL相關的系統要求、准則和限制,請參閱:實施中繼的系統要求。
若要建立本檔案中的範例,已使用以下交換器:
搭載Supervisor Engine II(WS-X4013)的Catalyst 4000交換器(執行CatOS軟體版本8.1.3)
搭載Supervisor Engine 2的Catalyst 6509/多層次交換功能卡2(MSFC2)(在Supervisor Engine和MSFC2上執行Cisco IOS軟體版本12.1(20)E2)
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
本檔案僅包含交換器的組態檔以及相關範例show命令的輸出。有關如何在Catalyst交換器之間設定802.1Q主幹的詳細資訊,請參閱LAN產品支援頁面。
在802.1Q中繼中,除了本徵VLAN外,所有VLAN資料包都標籤在中繼鏈路上。本徵VLAN資料包在TRUNK鏈路上無標籤傳送。因此,為中繼配置的兩台交換機上的本地VLAN應該相同。這樣,當您收到沒有標籤的幀時,可以推斷幀屬於哪個VLAN。預設情況下,VLAN 1是所有交換機上的本地VLAN。
在CatOS中,本徵VLAN可以透過發出set vlan vlan-id mod/port 命令來變更,其中mod/port 為主干連線埠。
在Cisco IOS軟體中,可以通過在中繼連線埠上設定的switchport trunk native vlan vlan-id interface命令來變更本地VLAN。
本節提供用於設定本文件中所述功能的資訊。
本文檔中的配置是在隔離的實驗室環境中實施的。使用前,請確認您已瞭解任何組態或指令可能對網路造成的影響。已使用clear config all和write erase命令清除所有裝置上的配置,以確保它們具有預設配置。
注意:要查詢有關本文檔中使用的命令的其他資訊,請使用命令查詢工具 (僅限註冊客戶)。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
注意:註釋和說明以藍色斜體顯示。
Catalyst 4000交換器 |
---|
#version 8.1(3) ! ! #system web interface version(s) ! #system set system name cat4000 ! #frame distribution method set port channel all distribution mac both ! #vtp set vtp domain cisco !--- In this example, the VLAN Trunk Protocol (VTP) domain name is the same !--- on both sides. This is required for the autonegotiation of the trunk !--- by the Dynamic Trunking Protocol (DTP). set vtp mode client vlan !--- In this example, the VTP mode is set to client. !--- Set the VTP mode according to your network requirements. !--- For more details, refer to !--- Understanding and Configuring VLAN Trunk Protocol (VTP). ! #ip set interface sc0 1 10.10.10.2/255.255.255.0 10.10.10.255 !--- This is the IP address used for management. !--- Output suppressed. ! #module 1 : 2-port 1000BaseX Supervisor ! #module 2 empty ! #module 3 empty ! #module 4 empty ! #module 5 : 48-port Inline Power Module set vlan 2 5/13-24 !--- Ports 5/13-24 have been assigned to VLAN 2. set trunk 5/1 desirable dot1q 1-1005,1025-4094 !--- The trunking mode is set to desirable mode, which means !--- the port automatically tries to form a trunk with a !--- neighboring port set to desirable, auto, or on mode. !--- For recommended trunk mode settings, refer to !--- the Dynamic Trunking Protocol section of !--- Best Practices for Catalyst 4500/4000, 5500/5000, and 6500/6000 Series Switches Running CatOS Configuration and Management. !--- Output suppressed. set spantree portfast 5/2-24 enable set port channel 5/2-24 mode off !--- The macro command set port host 5/2-24 was used to do three things: !--- disable trunking, disable port channeling, and enable spantree portfast. !--- For details on using the set port host command, refer to !--- Using Portfast and Other Commands to Fix Workstation Startup Connectivity Delays. ! #module 6 empty end |
Catalyst 6500交換器 |
---|
Current configuration : 4408 bytes ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname cat6500 ! boot system flash sup-bootflash:c6sup22-jsv-mz.121-20.E2 enable password mysecret !--- This is the privileged mode password used in the example. ! ip subnet-zero ! ! ! mls flow ip destination mls flow ipx destination ! redundancy mode rpr-plus main-cpu auto-sync running-config auto-sync standard ! ! ! interface GigabitEthernet2/1 no ip address shutdown ! interface GigabitEthernet2/2 no ip address shutdown ! interface fastethernet3/1 switchport !--- The switchport command must be entered once, !--- without any keywords, to configure the interface as a Layer 2 port. !--- The interface is now automatically configured with the default command !--- switchport mode dynamic desirable. !--- This means the interface is ready to autonegotiate trunking !--- encapsulation and form a trunk link (using DTP) with a neighbor port !--- in desirable, auto, or on mode. !--- For recommended trunk mode settings, refer to !--- the "Dynamic Trunking Protocol" section of !--- Best Practices for Catalyst 6500/6000 Series and Catalyst 4500/4000 Series Switches Running Cisco IOS Software. ! interface FastEthernet3/2 switchport switchport mode access spanning-tree portfast !--- The interface range fastethernet mod/beginport - endport !--- command is used to configure interfaces 3/2 - 24 at once. !--- Next, the switchport command is issued (if this has not been done already). switchport mode access spanning-tree portfast !--- Next, issue the macro command switchport host 3/2 - 24 to automatically !--- configure these ports as access ports and to enable spantree portfast. !--- For details on using the switchport host command, refer to !--- Using Portfast and Other Commands to Fix Workstation Startup Connectivity Delays. ! interface FastEthernet3/13 switchport switchport access vlan 2 !--- Interfaces 3/13 - 24 are placed in VLAN 2 !--- using the switchport access vlan 2 command. switchport mode access spanning-tree portfast !--- Output suppressed. ! interface FastEthernet3/24 shutdown switchport switchport access vlan 2 switchport mode access spanning-tree portfast !--- Output suppressed. ! interface FastEthernet3/48 no ip address shutdown ! interface vlan 1 ip address 10.10.10.3 255.255.255.0 !--- This is the IP address used for management. ! ip classless no ip http server ! ! ! line con 0 line vty 0 4 password mysecret !--- This is the Telnet password used in the example. login transport input lat pad mop telnet rlogin udptn nasi ! ! end cat6500# |
本節提供的資訊可用於確認您的組態是否正常運作。
Output Interpreter (僅供註冊客戶使用)工具支援某些show命令,此工具可讓您檢視show命令輸出的分析。
在執行CatOS的Catalyst交換器上,使用以下命令:
show port capabilities module/port
show port module/port
show trunk module/port
show vtp domain
在執行Cisco IOS軟體的Catalyst 6000交換器上,使用以下命令:
show interfaces interface-type module/port trunk
show vlan
show port capabilities module/port 命令用於檢查連線埠是否可建立主幹。
cat4000> (enable) show port capabilities 5/1 Model WS-X4148-RJ45V Port 5/1 Type 10/100BaseTX Speed auto,10,100 Duplex half,full Trunk encap type 802.1Q Trunk mode on,off,desirable,auto,nonegotiate Channel 5/1-48 Flow control no Security yes Dot1x yes Membership static,dynamic Fast start yes QOS scheduling rx-(none),tx-(2q1t) CoS rewrite no ToS rewrite no Rewrite no UDLD yes Inline power auto,off,static AuxiliaryVlan 1..1000,1025..4094,untagged,none SPAN source,destination,reflector Link debounce timer yes IGMPFilter yes Dot1q-all-tagged no cat4000> (enable)
show port module/port 命令會顯示特定連線埠的狀態以及它是否為主幹。
cat4000> (enable) show port status 5/1 Port Name Status Vlan Level Duplex Speed Type ----- ------------------ ---------- ---------- ------ ------ ----- ------------ 5/1 connected trunk normal a-full a-100 10/100BaseTX cat4000> (enable)
show trunk命令用於驗證中繼狀態和配置。
cat4000> (enable) show trunk * - indicates vtp domain mismatch # - indicates dot1q-all-tagged enabled on the port Port Mode Encapsulation Status Native vlan -------- ----------- ------------- ------------ ----------- 5/1 desirable dot1q trunking 1 Port Vlans allowed on trunk -------- --------------------------------------------------------------------- 5/1 1-1005,1025-4094 Port Vlans allowed and active in management domain -------- --------------------------------------------------------------------- 5/1 1-2 Port Vlans in spanning tree forwarding state and not pruned -------- --------------------------------------------------------------------- 5/1 1-2 cat4000> (enable)
show vtp domain命令用於檢查VTP資訊。
cat4000> (enable) show vtp domain Version : running VTP1 (VTP3 capable) Domain Name : cisco Password : not configured Notifications: disabled Updater ID: 10.10.10.3 Feature Mode Revision -------------- -------------- ----------- VLAN Client 21 Pruning : disabled VLANs prune eligible: 2-1000
show interfaces介面型別模組/port trunk命令會告知連線埠是否為主幹。
cat6500# show interfaces fastethernet 3/1 trunk Port Mode Encapsulation Status Native vlan Fa3/1 desirable n-802.1q trunking 1 Port Vlans allowed on trunk Fa3/1 1-4094 Port Vlans allowed and active in management domain Fa3/1 1-2 Port Vlans in spanning tree forwarding state and not pruned Fa3/1 1-2 cat6500#
show VLAN命令會提供有關VLAN以及屬於特定VLAN的連線埠的資訊。
cat6500# show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa3/2, Fa3/3, Fa3/4, Fa3/5 Fa3/6, Fa3/7, Fa3/8, Fa3/9 Fa3/10, Fa3/11, Fa3/12 2 VLAN0002 active Fa3/13, Fa3/14, Fa3/15, Fa3/16 Fa3/17, Fa3/18, Fa3/19, Fa3/20 Fa3/21, Fa3/22, Fa3/23, Fa3/24 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup !--- Output suppressed. cat6500#
注意:僅顯示配置為第2層非中繼埠的埠。
目前尚無適用於此組態的具體疑難排解資訊。