簡介
本檔案介紹執行Cisco IOS®軟體的Cisco Catalyst交換器之間IEEE 802.1Q (dot1q)中繼的差異。
必要條件
需求
嘗試此組態之前,請確保符合以下要求:
採用元件
本文中的資訊係根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
本文檔提供運行Cisco IOS®軟體的Cisco Catalyst 3560交換機與Catalyst 6500系列交換機之間的IEEE 802.1Q (dot1q)中繼的示例配置。主幹連線是在兩個裝置之間,透過點對點連結,從多個 VLAN 攜帶流量的方式。
在傳統平台上,有兩種方法可以實施乙太網中繼:
-
交換器間連結通訊協定(ISL)—Cisco專有通訊協定
-
802.1Q - IEEE標準
Catalyst元件
本檔案中的Catalyst 3560和6500組態亦適用於執行Cisco IOS軟體的其他Catalyst交換器。
注意:請參閱以下文檔以瞭解各種Catalyst交換機支援的中繼方法:
注意:本文檔僅包括來自交換機的配置檔案以及相關示例 show 命令的輸出。有關如何在Catalyst交換機之間配置802.1Q TRUNK的詳細資訊,請參閱以下文檔:
背景理論
IEEE 802.1Q使用內部標籤機制。中繼裝置插入4位元組的標籤以標識幀所屬的VLAN,然後重新計算幀校驗序列(FCS)。如需詳細資訊,請參閱下列檔案:
注意:以下是針對此配置的重要說明:
-
Catalyst 3560/3750系列交換機上的任何乙太網介面都可以支援802.1Q和ISL封裝。預設情況下,Catalyst 3550交換機上的乙太網介面是第2層(L2)埠。
-
Catalyst 6500/6000系列交換機上的任何乙太網埠都可以支援802.1Q和ISL封裝。
-
預設情況下,運行Cisco IOS軟體的Catalyst 4500系列交換機支援ISL和802.1Q中繼模式。除了在WS-X4418-GB和WS-X4412-2GB-T模組上阻塞Gigabit埠外,所有介面均支援此功能。這些埠不支援ISL並且僅支援802.1Q中繼。埠3至18阻塞WS-X4418-GB模組上的千兆埠。埠1至12阻塞WS-X4412-2GB-T模組上的千兆埠。
注意:如果埠與背板的連線超額訂閱,則該埠為阻塞埠。
-
Catalyst 6500和Catalyst 4500平台之間的主要區別是預設介面配置。運行Cisco IOS軟體的Catalyst 6500交換機的預設關閉模式下的介面是第3層(L3)路由埠。運行Cisco IOS軟體的Catalyst 4500交換機啟用了所有介面。預設情況下,這些介面是L2交換機埠。
-
當802.1Q封裝用於Catalyst 3750交換機上的中繼介面時,可在 show interface 輸出中看到殘幀,因為61-64位元組的有效802.1Q封裝資料包(包括q標籤)被Catalyst 3750交換機算作是過小幀,即使這些資料包被正確地轉發。
注意:請注意,運行Cisco IOS XE的最新Catalyst交換機(例如3650/3850及更高版本)不再支援ISL協定。
設定
本節提供用於設定本文件中所述功能的資訊。
網路圖表
此文件使用以下網路設定:
注意:Catalyst 3560上的千兆乙太網介面是10/100/1000 Mbps協商乙太網介面。因此,在此網路圖表中,Catalyst 3560上的千兆連線埠連線到Catalyst 6500上的快速乙太網路(100 Mbps)連線埠。
網路圖表
組態
本檔案使用下列組態:
Catalyst 3560交換器 |
!--- Notice: This example creates VLAN 1 and VLAN 2 !--- and sets the VLAN Trunk Protocol (VTP) mode to transparent. Use your !--- network as a basis and set the VTP mode accordingly. For more details, !--- refer to Configuring VLANs.
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname 3560
!
!--- This is the privileged mode password for the example.
enable password mysecret
!
ip subnet-zero
!
vtp mode transparent
!
!--- VLAN 2 is created. This is visible only when you set VTP mode !--- to transparent.
vlan 2
!
!--- The Gigabit Ethernet interface on the Catalyst 3560 is a 10/100/1000 Mbps !--- negotiated Ethernet interface. Therefore, the Gigabit port on the !--- Catalyst 3560 is connected to a Fast Ethernet port on the Catalyst 6500. !--- Configure the trunk on the Gigabit Ethernet 0/1 interface.
interface GigabitEthernet0/1
!--- Configure trunk encapsulation as dot1q. !--- For details on trunking, refer to Configuring VLANs.
switchport trunk encapsulation dot1q
!--- Enable trunking on the interface.
switchport mode trunk
no ip address
snmp trap link-status
!
!
!--- Interfaces Gigabit Ethernet 0/2 through 0/5 are placed in VLAN 1. !--- In order to configure the interface as an L2 port, !--- refer to the Configuring Ethernet Interfaces section !--- of Configuring Interface Characteristics. All L2 ports are placed !--- in VLAN 1, by default.
interface GigabitEthernet0/2
switchport mode access
no ip address
snmp trap link-status
!
interface GigabitEthernet0/3
switchport mode access
no ip address
snmp trap link-status
!
!
interface GigabitEthernet0/4
switchport mode access
no ip address
snmp trap link-status
!
interface GigabitEthernet0/5
switchport mode access
no ip address
snmp trap link-status
!
!
!--- Interfaces Gigabit Ethernet 0/6 through 0/12 are placed in VLAN 2.
interface GigabitEthernet0/6
switchport access vlan 2
switchport mode access
no ip address
snmp trap link-status
!
!--- Output suppressed.
!
interface GigabitEthernet0/12
switchport access vlan 2
switchport mode access
no ip address
snmp trap link-status
!
interface Vlan1
!--- This is the IP address for management.
ip address 10.1.1.1 255.255.255.0
!
ip classless
ip http server
!
!
line con 0
transport input none
line vty 0 4
!--- This is the privileged mode password for the example.
password mysecret
login
line vty 5 15
login
!
end |
Catalyst 6500交換器 |
!--- Notice: This example creates VLAN 1 and VLAN 2 and sets !--- the VTP mode to transparent. Use your network as a basis and set the VTP !--- mode accordingly. For more details, refer to Configuring VLANs.
Current configuration : 4812 bytes
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Cat6500
!
vtp mode transparent
ip subnet-zero
!
!
mls flow ip destination
mls flow ipx destination
!
!--- This is the privileged mode password for the example.
enable password mysecret
!
redundancy
mode rpr-plus
main-cpu
auto-sync running-config
auto-sync standard
!
!
!--- This enables VLAN 2.
vlan 2
!
interface GigabitEthernet1/1
no ip address
shutdown
!
interface GigabitEthernet1/2
no ip address
shutdown
!
!--- The Gigabit Ethernet interface on the Catalyst 3560 is a 10/100/1000 Mbps !--- negotiated Ethernet interface. Therefore, the Gigabit port on the Catalyst 3560 !--- is connected to a Fast Ethernet port on the Catalyst 6500.
interface FastEthernet3/1
no ip address
!--- You must issue the switchport command once, !--- without any keywords, in order to configure the interface as an L2 port for the !--- Catalyst 6500 series switch that runs Cisco IOS Software. !--- On a Catalyst 4500 series switch that runs Cisco IOS Software, all ports are L2 !--- ports by default. Therefore, if you do not change the default configuration, !--- you do not need to issue the switchport command.
switchport
!--- Configure trunk encapsulation as dot1q. !--- For more details on trunking, refer to !--- Configuring LAN Ports for Layer 2 Switching for the Catalyst 6500 series switch !--- that runs Cisco IOS Software, or Configuring Layer 2 Ethernet Interfaces !--- for the Catalyst 4500/4000 series switch that runs Cisco IOS Software.
switchport trunk encapsulation dot1q
!--- Enable trunking on the interface.
switchport mode trunk
!
!--- Configure interfaces Fast Ethernet 3/2 through 3/24 to be in access mode. !--- By default, all access ports are configured in VLAN 1.
interface FastEthernet3/2
no ip address
switchport
switchport mode access
!
!--- Output suppressed.
!
interface FastEthernet3/24
no ip address
switchport
switchport mode access
!
!--- Fast Ethernet 3/25 through 3/48 are placed in VLAN 2.
interface FastEthernet3/25
no ip address
switchport
switchport access vlan 2
switchport mode access
!
!--- Output suppressed.
!
interface FastEthernet3/48
no ip address
switchport
switchport access vlan 2
switchport mode access
!
!
interface Vlan1
!--- This is the IP address for management.
ip address 10.1.1.2 255.255.255.0
!
!
ip classless
no ip http server
!
!
ip classless
ip http server
!
line con 0
exec-timeout 0 0
transport input none
line vty 0 4
!--- This is the Telnet password for the example.
password mysecret
login
!
end |
注意:如果為不存在的VLAN分配介面,該介面將關閉,直到您在VLAN資料庫中建立VLAN。有關詳細資訊,請參閱配置VLAN 的建立或修改乙太網VLAN 部分。
驗證
使用本節內容,確認您的組態是否正常運作。在Catalyst 3560/3750/6500/4500交換器上,使用以下命令:
-
show interfaces <interface_type module/port> trunk
-
show interfaces <interface_type module/port> switchport
-
show vlan
-
show vtp status
show
命令輸出示例
Catalyst 3560交換器
-
show interfaces <interface_type module/por> trunk —此命令顯示介面的中繼配置以及能夠透過中繼為其傳輸流量的VLAN編號。
3560#show interface gigabitethernet 0/1 trunk
Port Mode Encapsulation Status Native vlan
Gi0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi0/1 1 4094
Port Vlans allowed and active in management domain
Gi0/1 1-2
Port Vlans in spanning tree forwarding state and not pruned
Gi0/1 1-2
-
show interfaces <interface_type module/port> switchport —此命令顯示介面的交換機埠配置。
在顯示器中,選中Operational Mode 和Operational Trunking Encapsulation 欄位。
3560#show interface gigabitethernet 0/1 switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust : none
-
show vlan -此命令提供有關VLAN及屬於特定VLAN的埠的資訊。
3560#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/2, Gi0/3, Gi0/4, Gi0/5
2 VLAN0002 active Gi0/6, Gi0/7, Gi0/8, Gi0/9
Gi0/10, Gi0/11, Gi0/12
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
!--- Output suppressed.
註:輸出中顯示的埠僅為接入埠。但是,配置為中繼以及處於未連線狀態的埠也顯示在show vlan輸出中。
-
show vtp status —此命令顯示有關VTP管理域、狀態和計數器的一般資訊。
3560#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs : 6
VTP Operating Mode : Transparent
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x4A 0x55 0x17 0x84 0xDB 0x99 0x3F 0xD1
Configuration last modified by 10.1.1.1 at 0-0-00 00:00:00
3560#ping 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
3560#
Catalyst 6500交換器
-
show interfaces <interface_type module/port> trunk -此命令顯示介面的中繼配置以及能夠透過中繼為其傳輸流量的VLAN編號。
Cat6500#show interfaces fastethernet 3/1 trunk
Port Mode Encapsulation Status Native vlan
Fa3/1 on 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
-
show interfaces <interface_type module/port> switchport —此命令顯示介面的交換機埠配置。 在顯示器中,選中Operational Mode 和Operational Trunking Encapsulation 欄位。
cat6500#show interface fastethernet 3/1 switchport
Name: Fa3/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
-
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, Fa3/13
Fa3/14, Fa3/15, Fa3/16, Fa3/17
Fa3/18, Fa3/19, Fa3/20, Fa3/21
Fa3/22, Fa3/23, Fa3/24
2 VLAN0002 active Fa3/25, Fa3/26, Fa3/27, Fa3/28
Fa3/29, Fa3/30, Fa3/31, Fa3/32
Fa3/33, Fa3/34, Fa3/35, Fa3/36
Fa3/37, Fa3/38, Fa3/39, Fa3/40
Fa3/41, Fa3/42, Fa3/43, Fa3/44
Fa3/45, Fa3/46, Fa3/47, Fa3/48
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
注意:顯示的埠僅限已配置為第2層非中繼(接入)埠的埠。配置為中繼以及未連線狀態的埠也顯示在show vlan輸出中。有關詳細資訊,請參閱配置用於第2層交換的LAN埠的「配置用於第2層交換的LAN介面」部分。
-
show vtp status —此命令顯示有關VTP管理域、狀態和計數器的一般資訊。
Cat6500#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs : 6
VTP Operating Mode : Transparent
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xBF 0x86 0x94 0x45 0xFC 0xDF 0xB5 0x70
Configuration last modified by 10.1.1.2 at 0-0-00 00:00:00
-
ping
Cat6500#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
相關資訊