本文档提供了 Catalyst 3512-XL 交换机和 Cisco 2600 路由器之间的交换机间链路 (ISL) 以及 802.1Q 中继的配置示例。执行命令时,每个命令的结果都将显示出来。Cisco 3600 及 4500/4700 系列路由器,或者 Cisco 2600 系列的其他路由器(具有快速以太网接口),以及任何 Catalyst 2900XL、3500XL、2940、2950 或 2970 交换机都可以在本文档所述的情况下使用,并可得到相同的结果。
中继是一种在两个设备之间点到点链路上传输来自若干 VLAN 的流量的方式。实施以太网中继的方法有如下两种:
ISL(Cisco 专有协议,2940 或 2950 系列交换机不支持此协议)
802.1Q(电气和电子工程师协会 (IEEE) 标准)
我们将创建在 Catalyst 3500 和 Cisco 2600 路由器之间的单条链路上传输来自 2 个 VLAN(VLAN1 和 VLAN2)的数据流的中继。
我们使用Cisco 2600路由器在VLAN1和VLAN2之间执行VLAN间路由。Catalyst 2900XL/3500XL/2940/2950/2970系列交换机是第2层(L2)交换机,不能在VLAN之间路由或通信。有关 VLAN 间路由的更多详细信息,请参阅 Cisco IOS® 交换服务配置指南 12.1 版的虚拟 LAN 之间的路由概述一章。
为了创建本文档中的示例,我们在实验室环境下使用了采用原始配置的以下交换机:
运行 Cisco IOS 12.0(5.x)XU 的 Catalyst 3512XL 交换机
运行 Cisco IOS 12.1(3)T 的 Cisco 2621 路由器
运行 Cisco IOS 12.1(1)T 的 Cisco 2621 路由器
本文档中的配置在隔离的实验室环境中实施。在使用任何配置或命令之前,您必须确保知道其可能对网络带来的潜在影响。使用 write erase 命令清除所有设备上的配置,以保证它们具有默认配置。
有关文件规则的更多信息请参见“ Cisco技术提示规则”。
本文档没有任何特定的前提条件。
本文档不限于特定的软件和硬件版本。
对于 Catalyst 2900XL/3500XL/2940/2950/2970 交换机:
Catalyst 2940 和 2950 系列交换机只支持 802.1q 中继,不支持 ISL 中继。
在 4 MB DRAM Catalyst 2900xl 交换机上,只有支持中继的以下模块才支持建立中继:
WS-X2914-XL-V:4 端口 10/100 ISL/802.1Q 交换机模块
WS-X2922-XL-V:2 端口 100BaseFX ISL/802.1Q 交换机模块
WS-X2924-XL-V:4 端口 100BaseFX ISL/802.1Q 交换机模块
WS-X2931-XL:Catalyst 2900 XL 的 1000BaseX 上行链路
WS-X2932-XL:Catalyst 2900 XL 的 1000BaseT 上行链路
参考下面的表 1,了解当前支持中继的交换机型号:
表 1
交换机型号 | ISL 中继所要求的最低版本 | IEEE 802.1Q 中继所要求的最低版本 | 中继 (ISL/802.1Q) 所要求的当前版本 |
---|---|---|---|
WS-C2916M-XL(4 兆交换机) | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 11.2(8.6)SA6(原始版本) |
C2912-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
C2924-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C2924C-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C2924M-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C2912MF-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C2924M-XL-DC | 12.0(5)XU | 12.0(5)XU | 12.0(5)WC(1) 或更高版本 |
WS-C3508G-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C3512-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(原始版本) | 12.0(5)WC(1) 或更高版本 |
WS-C3524-XL | 11.2(8)SA4(企业版) | 11.2(8)SA5(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C3548-XL | 12.0(5)XP(企业版) | 12.0(5)XP(企业版) | 12.0(5)WC(1) 或更高版本 |
WS-C3524-PWR-XL | 12.0(5)XU | 12.0(5)XU | 12.0(5)WC(1) 或更高版本 |
WS-C2940-8TF | 不支持 ISL | 12.1(13)AY | 12.1(13)AY 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2940-8TT | 不支持 ISL | 12.1(13)AY | 12.1(13)AY 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950-12 | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950-24 | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950C-24 | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950T-24 | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950G-12-EI | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950G-24-EI | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950G-48-EI | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950SX-24 | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2950-24-EI-DC | 不支持 ISL | 12.0(5)WC(1) | 12.0(5)WC(1) 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2955T-12 | 不支持 ISL | 12.1(13)EA1 | 12.1(13)EA1 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2955S-12 | 不支持 ISL | 12.1(13)EA1 | 12.1(13)EA1 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2955C-12 | 不支持 ISL | 12.1(13)EA1 | 12.1(13)EA1 或以上版本,支持 802.1Q。不支持 ISL。 |
WS-C2970G-24T | 12.1(11)AX | 12.1(11)AX | 12.1(11)AX 或以上版本 |
WS-C2970G-24TS | 12.1(14)EA1 | 12.1(14)EA1 | 12.1(14)EA1 或以上版本 |
注意:在上表中,只有WS-C2916M-XL是4 MB DRAM交换机。所列的所有其他交换机均为 8 MB DRAM 交换机。若要确定您的交换机的 DRAM 为 4 MB 还是 8 MB,请输入用户级 show version 命令。有关详细信息,请参阅使用命令行界面升级 Catalyst 2900-XL/3500-XL 交换机软件中的如何使用命令行界面确定交换机内存容量部分。
注意:在Catalyst 2900XL/3500XL/2940/2950/2970交换机中,可以为交换机上配置的每个VLAN创建VLAN接口,例如int vlan 1、int vlan 2、int vlan x。然而,每次只有一个 VLAN 可用作管理 VLAN。IP 地址只分配到管理 VLAN 的 VLAN 接口。如果 IP 地址分配到非管理 VLAN 的 VLAN 接口,则该接口不会进入工作状态。首选的做法是只为管理 VLAN 创建 VLAN 接口。
对于 Cisco 2600 路由器:
在使用 802.1Q 中继时,有一个 VLAN 不会被标记。此 VLAN 称为本地 VLAN。当端口在 802.1Q 中继模式下时,本地 VLAN 用于未标记的数据流。配置 802.1Q 中继时,记住在中继链路的两端必须配置同样的本地 VLAN。在路由器和交换机之间配置 802.1Q 中继时,本地 VLAN 不匹配是常见的错误。有关本地 VLAN 的详细信息,请参阅“版本 12.1(3)T 中的新功能”中的 IEEE 802.1Q VLAN 之间的桥接的 IEEE 802.1Q 部分。
在本示例配置中,Cisco 2621 路由器和 Catalyst 3512XL 交换机上的默认本地 VLAN 都是 VLAN1。根据网络需求,您可能必须使用除默认VLAN VLAN 1以外的本征VLAN。本文档的配置部分已提到了如何更改Cisco 2600路由器和Catalyst 3500XL交换机上的本征VLAN的命令。
本文档中介绍的示例配置可用于具有快速以太网接口或快速以太网网络模块的 Cisco 2600/3600/4500/4700 系列路由器。此外,请确保您使用的是支持 ISL/802.1Q VLAN 中继的 Cisco IOS 版本。要获得支持 ISL/802.1Q VLAN 中继的 Cisco 2600/3600/4500/4700 路由器和所支持的 Cisco IOS 版本的完整列表,请参阅下面的表 2。
表 2
路由器型号 | ISL 中继所要求的最低版本 | IEEE 802.1Q 中继所要求的最低版本 | 所要求的最低功能集 (ISL/802.1Q) |
---|---|---|---|
Cisco 2620 | 11.3(3a)T | 12.0(1)T | IP PLUS/IP PLUS |
Cisco 2621 | 11.3(3a)T | 12.0(1)T | IP PLUS/IP PLUS |
Cisco 2620 | 12.1(3a)T | 12.1(3a)T | IP PLUS/IP PLUS |
Cisco 2650 | 12.1(3a)T | 12.1(3a)T | IP PLUS/IP PLUS |
Cisco 3620 | 11.3(1)T | 12.0(1)T | IP PLUS/IP PLUS |
Cisco 3640 | 11.3(1)T | 12.0(1)T | IP PLUS/IP PLUS |
Cisco 3661 | 12.0(5)T | 12.0(5)T | IP PLUS/IP PLUS |
Cisco 3662 | 12.0(5)T | 12.0(5)T | IP PLUS/IP PLUS |
Cisco 4500-M | 11.3(1)T | 12.0(1)T | IP PLUS/IP PLUS |
Cisco 4700-M | 11.3(1)T | 12.0(1)T | IP PLUS/IP PLUS |
注:表2仅列出支持此示例配置的最低或当前维护/主要版本。带有某些网络模块的路由器型号可能有不同的最低 Cisco IOS 版本要求。要了解任意路由器系列支持的全部最低软件版本,请使用 Software Advisor(仅限注册用户)。
注:支持的最低版本不一定是建议的版本。要确定适用于您的思科产品的最佳维护版本,请在 Bug 工具包(仅限注册用户)中搜索按产品组件列出的 Bug。
注意:表2列出了支持此示例配置的IP VLAN间路由和中继所需的最低功能集。要了解不同 Cisco IOS 版本和不同平台所支持的所有其他功能集,请使用软件下载区。
本部分提供有关如何配置本文档所述功能的信息。
注:要查找有关本文档中使用的命令的其他信息,请使用命令查找工具(仅注册客户)。
本文档使用下图所示的网络设置。
本文档使用如下所示的配置。
注意:具有某些网络模块的路由器型号可能具有不同的支持ISL中继的最低Cisco IOS版本。
Catalyst 3512-XL
Cisco 2600 路由器
使用版本低于 12.1(3)T 的 Cisco IOS 的路由器的 802.1Q 配置
Catalyst 3512-XL |
---|
注意:以下屏幕截图显示在3512XL交换机上输入的命令。命令之间的备注添加为蓝色斜体,旨在解释特定命令和步骤。 !-- Set the privileged mode !-- and Telnet password on the switch. switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)#hostname 3512xl 3512xl(config)#enable password mysecret 3512xl(config)#line vty 0 4 3512xl(config-line)#login 3512xl(config-line)#password mysecret 3512xl(config-line)#exit 3512xl(config)#no logging console 3512xl(config)#^Z !-- Set the IP address and default gateway for VLAN1 for management purposes. 3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 3512xl(config)#int vlan 1 3512xl(config-if)#ip address 10.10.10.2 255.255.255.0 3512xl(config-if)#exit 3512xl(config)#ip default-gateway 10.10.10.1 3512xl(config)#end !-- Set the VTP Mode. !-- In our example, we have set the mode to be transparent. !-- Depending on your network, set the VTP Mode accordingly. !-- For details on VTP, !-- refer to !-- Creating and Maintaining VLANs on Catalyst 2900XL and 3500XL Switches. 3512xl#vlan database 3512xl(vlan)#vtp transparent Setting device to VTP TRANSPARENT mode. !-- Adding VLAN2. VLAN1 already exists by default. 3512xl(vlan)#vlan 2 VLAN 2 added: Name: VLAN0002 3512xl(vlan)#exit APPLY completed. Exiting.... !-- Enable trunking on the interface fastEthernet 0/1. 3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 3512xl(config)#int fastEthernet 0/1 3512xl(config-if)#switchport mode trunk !-- Enter the trunking encapsulation as either isl 3512xl(config-if)#switchport trunk encapsulation isl !-- or as dot1q: 3512xl(config-if)#switchport trunk encapsulation dot1q !-- In case of 2940/2950 series switches, none of the above two commands are used, !-- 2940/2950 series switches only support 802.1q encapsulation which is configured automatically, !-- when trunking is enabled on the interface by using switchport mode trunk command. !-- In case of dot1q, you need to make sure that !-- the native VLAN matches across the link. !-- On 3512XL, by default, the native VLAN is 1. !-- Depending on your network needs, you may change !-- the native VLAN to be other than VLAN1, !-- but it is very important that you change the native VLAN !-- on the router accordingly. !-- You may change the native VLAN, if needed, by using the following command: !-- 3512xl(config-if)#switchport trunk native vlan |
2600 路由器 |
---|
注意:以下屏幕截图显示在Cisco 2600路由器上输入的命令。命令之间的备注添加为蓝色斜体,旨在解释特定命令和步骤。 !-- Set the privileged mode !-- and Telnet password on the router. Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname c2600 c2600(config)#enable password mysecret c2600(config)#line vty 0 4 c2600(config-line)#login c2600(config-line)#password mysecret c2600(config-line)#exit c2600(config)#no logging console c2600(config)#^Z c2600#configure terminal Enter configuration commands, one per line. End with CNTL/Z. !-- Select FastEthernet 0/0 for the trunk configuration. !-- No L2 or Layer 3 (L3) configuration is done here. c2600(config)#int fastEthernet 0/0 c2600(config-if)#no shut c2600(config-if)#exit !-- Enable trunking on the sub-interface FastEthernet 0/0.1. !-- Note that actual trunks are configured on the sub-interfaces. c2600(config)#int fastEthernet 0/0.1 !-- Enter the trunking encapsulation as either isl c2600(config-subif)#encapsulation isl 1 !-- or as dot1q: !-- In case of dot1q, you need to make sure that !-- the native VLAN matches across the link. !-- On 3512XL, by default, the native VLAN is 1. !-- On the router, configure VLAN1 as the native VLAN. c2600(config-subif)#encapsulation dot1Q 1 ? native Make this is native vlan <cr> c2600(config-subif)#encapsulation dot1Q 1 native !-- On the switch, if you have a native VLAN other than VLAN1, !-- on the router, configure the same VLAN to be the native VLAN, !-- by using the above command. 注意:在Cisco IOS版本12.1(3)T中添加了encapsulation dot1Q 1 native命令。如果您使用的是更早的 Cisco IOS 版本,请参阅本文档的“版本低于 12.1(3)T 的 Cisco IOS 的 802.1Q 配置”部分,以便在路由器上配置 802.1Q 中继。 !-- Configure L3 information on the sub-interface 0/0.1. c2600(config-subif)#ip address 10.10.10.1 255.255.255.0 c2600(config-subif)#exit !-- Enable trunking on the sub-interface FastEthernet 0/0.2. !-- Note that actual trunks are configured on the sub-interfaces. c2600(config)#int fastEthernet 0/0.2 !-- Enter the trunking encapsulation as either isl c2600(config-subif)#encapsulation isl 2 !-- or as dot1q: c2600(config-subif)#encapsulation dot1Q 2 !-- Configure L3 information on the sub-interface 0/0.2. c2600(config-subif)#ip address 10.10.11.1 255.255.255.0 c2600(config-subif)#exit c2600(config)#^Z !-- Remember to save the configuration. c2600#write memory Building configuration... [OK] c2600# 注意:要使此设置正常工作,并在工作站1和工作站2之间成功ping通,您需要确保工作站上的默认网关设置正确。对于workstation1,默认网关应为10.10.11.1,对于workstation2,默认网关应为10.10.10.1。有关如何在工作站上设置默认网关的详细信息,请参阅本文档中各节。 注意:以下段落仅适用于在路由器和交换机之间配置了802.1Q中继的情况。 注:如果您遵循了上述部分中列出的配置步骤,但仍无法通过VLAN(在工作站1和工作站2之间)ping通,则可能遇到了警告CSCds42715,其中802.1Q native VLAN关键字在启用快速交换时无法正常工作。该 Bug 的修复程序集成到了下列代码版本中:12.2(0.5)、12.2(0.5)T、12.1(5)DC、12.1(5)YB、12.2(0.18)S、12.1(5)YD02、12.2(2)B、12.2(15)ZN。您可以通过使用 Bug 工具包(仅限注册用户)并输入 Bug ID CSCds42715 来检查该 Bug 的状况和简要描述。 -------------------------------------------------------------------------------- c2600#show running-config Building configuration... Current configuration: ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname c2600 ! no logging console enable password mysecret ! ! ! ! ! ip subnet-zero ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.1 encapsulation isl 1 ip address 10.10.10.1 255.255.255.0 no ip redirects ! !-- If 802.1Q is configured, !-- you will instead see the following output !-- under interface FastEthernet0/0.1: !-- interface FastEthernet0/0.1 !-- encapsulation dot1Q 1 native !-- ip address 10.10.10.1 255.255.255.0 ! ! interface FastEthernet0/0.2 encapsulation isl 2 ip address 10.10.11.1 255.255.255.0 no ip redirects ! !-- If 802.1Q is configured, !-- you will instead see the following output !-- under interface FastEthernet0/0.2: !-- interface FastEthernet0/0.2 !-- encapsulation dot1Q 2 !-- ip address 10.10.11.1 255.255.255.0 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! ip classless no ip http server ! ! ! line con 0 transport input none line aux 0 line vty 0 4 password mysecret login ! no scheduler allocate end |
使用版本低于 12.1(3)T 的 Cisco IOS 的路由器的 802.1Q 配置 |
---|
如本文档前面部分所述,配置 802.1Q 中继时,匹配链路两端的本地 VLAN 非常重要。在早于 12.1(3)T 的 Cisco IOS 软件版本中,因为子接口下的 encapsulation dot1Q 1 native 命令不可用,所以您不能明确地定义本地 VLAN。在早期的Cisco IOS版本中,必须将本征VLAN接口配置为子接口,而不是子接口,这在我们的VLAN1示例中是如此。如果配置错误,路由器将期望VLAN1上有标记dot1q帧,而交换机不期望VLAN1上有标记。因此,交换机和路由器上的VLAN1之间不会有流量通过。在这些情况下,务必将本地 VLAN 的配置放在主接口下,并在中继上为所有其他 VLAN 创建子接口。在当前的实验室设置下,使用下列步骤配置 Cisco 2600 路由器: !-- Set the privileged mode !-- and Telnet password on the router. Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname c2600 c2600(config)#enable password mysecret c2600(config)#line vty 0 4 c2600(config-line)#login; c2600(config-line)#password mysecret c2600(config-line)#exit c2600(config)#no logging console c2600(config)#^Z c2600#configure terminal Enter configuration commands, one per line. End with CNTL/Z. !-- Select FastEthernet 0/0 for the trunk configuration. c2600(config)#int fastEthernet 0/0 c2600(config-if)#no shut !-- Note that the IP address for VLAN1 is configured on the main interface, !-- and no encapsulation for VLAN1 will be done under the sub-interface. c2600(config-if)#ip address 10.10.10.1 255.255.255.0 c2600(config-if)#exit !-- Configure dot1q encapsulation for VLAN 2 !-- on sub-interface fastEthernet 0/0.2. c2600(config)#int fastEthernet 0/0.2 c2600(config-subif)#encapsulation dot1Q 2 c2600(config-subif)# !-- Configuring L3 information on the sub-interface 0/0.2. c2600(config-subif)#ip address 10.10.11.1 255.255.255.0 c2600(config-subif)#exit c2600(config)#^Z !-- Remember to save the configuration. c2600#write memory Building configuration... [OK] c2600# 注意:要使此设置正常工作并在工作站1和工作站2之间成功执行ping操作,您需要确保工作站上的默认网关设置正确。对于workstation1,默认网关应为10.10.11.1,对于workstation2,默认网关应为10.10.10.1。有关如何在工作站上设置默认网关的详细信息,请参阅本文档中各节。 c2600#show running-config Building configuration... Current configuration: ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname c2600 ! no logging console enable password mysecret ! ! ! ! ! memory-size iomem 7 ip subnet-zero ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 10.10.10.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/0.2 encapsulation dot1Q 2 ip address 10.10.11.1 255.255.255.0 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! ip classless no ip http server ! ! line con 0 transport input none line aux 0 line vty 0 4 password mysecret login ! no scheduler allocate end c2600# |
本部分所提供的信息可用于确认您的配置是否正常工作。
命令输出解释程序工具(仅限注册用户)支持某些 show 命令,使用此工具可以查看对 show 命令输出的分析。
在 Catalyst 2900XL/3500XL/2940/2950/2970 交换机上,使用下列命令:
show int {FastEthernet | GigabitEthernet} <module/port> switchport
show vlan
show vtp status
在 Cisco 2600 路由器上,使用下列命令:
show vlan
show interface
show int {FastEthernet | GigabitEthernet} <module/port> switchport
此命令用来检查端口的管理和运行状态。还用来确保中继两端的本地 VLAN 互相匹配。当端口在 802.1Q 中继模式下时,本地 VLAN 用于未标记的数据流。有关本地 VLAN 的详细信息,请参阅在 Catalyst 2900XL 和 3500XL 交换机上创建和维护 VLAN。
3512xl#show int fastEthernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: isl Operational Trunking Encapsulation: isl 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
注意:对于802.1Q中继,上述命令的输出将更改如下:
3512xl#show int fastEthernet 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
show vlan
此命令用于验证接口(端口)是否属于正确的 VLAN。在本例中,只有接口Fa0/2属于VLAN2。其余为VLAN1的成员。
3512xl#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Gi0/1, Gi0/2 2 VLAN0002 active Fa0/2 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active ...(output suppressed)
show vtp status
此命令用来检查交换机上的 VLAN 中继协议 (VTP) 配置。在我们的示例中,我们使用了透明模式。正确的 VTP 模式取决于网络拓扑结构。有关 VTP 的详细信息,请参阅在 Catalyst 2900XL 和 3500XL 交换机上创建和维护 VLAN。
3512xl#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 254 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 : 0xC3 0x71 0xF9 0x77 0x2B 0xAC 0x5C 0x97 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
show vlan
此命令可告知您为每个 VLAN 配置的 L2 或 L3 信息。
c2600#show vlan Virtual LAN ID: 1 (Inter Switch Link Encapsulation) vLAN Trunk Interface: FastEthernet0/0.1 Protocols Configured: Address: Received: Transmitted: IP 10.10.10.1 40 38 Virtual LAN ID: 2 (Inter Switch Link Encapsulation) vLAN Trunk Interface: FastEthernet0/0.2 Protocols Configured: Address: Received: Transmitted: IP 10.10.11.1 9 9
注意:对于802.1Q中继,上述命令的输出将更改如下:
c2600#show vlan Virtual LAN ID: 1 (IEEE 802.1Q Encapsulation) vLAN Trunk Interface: FastEthernet0/0.1 This is configured as native Vlan for the following interface(s): FastEthernet0/0 Protocols Configured: Address: Received: Transmitted: IP 10.10.10.1 0 2 Virtual LAN ID: 2 (IEEE 802.1Q Encapsulation) vLAN Trunk Interface: FastEthernet0/0.2 Protocols Configured: Address: Received: Transmitted: IP 10.10.11.1 42 19
注意:对于802.1Q中继,如果Cisco IOS版本早于12.1(3)T,则命令的输出将更改如下:
c2600#show vlan Virtual LAN ID: 2 (IEEE 802.1Q Encapsulation) vLAN Trunk Interface: FastEthernet0/0.2 Protocols Configured: Address: Received: Transmitted: IP 10.10.11.1 6 4
注意:在任何子接口上,VLAN1均不显示IEEE 802.1Q封装。
show interface
此命令用来检查接口的管理和运行状态。
c2600#show interfaces fastEthernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0) MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 100Mb/s, 100BaseTX/FX ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:07, output hang never Last clearing of "show interface" counters never Queueing strategy: fifo Output queue 0/40, 0 drops; input queue 0/75, 0 drops 5 minute input rate 0 bits/sec, 1 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 217 packets input, 12884 bytes Received 217 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog 0 input packets with dribble condition detected 45 packets output, 6211 bytes, 0 underruns(0/0/0) 0 output errors, 0 collisions, 4 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out c2600#show interfaces fastEthernet 0/0.1 FastEthernet0/0.1 is up, line protocol is up Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0) Internet address is 10.10.10.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ISL Virtual LAN, Color 1. ARP type: ARPA, ARP Timeout 04:00:00 c2600#show interfaces fastEthernet 0/0.2 FastEthernet0/0.2 is up, line protocol is up Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0) Internet address is 10.10.11.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ISL Virtual LAN, Color 2. ARP type: ARPA, ARP Timeout 04:00:00
注意:对于802.1Q中继,上述命令的输出将更改如下:
c2600#show interfaces fastEthernet 0/0.1 FastEthernet0/0.1 is up, line protocol is up Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0) Internet address is 10.10.10.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation 802.1Q Virtual LAN, Vlan ID 1. ARP type: ARPA, ARP Timeout 04:00:00 c2600#show interfaces fastEthernet 0/0.2 FastEthernet0/0.2 is up, line protocol is up Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0) Internet address is 10.10.11.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation 802.1Q Virtual LAN, Vlan ID 2. ARP type: ARPA, ARP Timeout 04:00:00