此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍如何在运行Cisco IOS®系统软件的Catalyst交换机上创建VLAN。
Cisco 建议您了解此部分的信息。
VLAN 机制允许网络管理员创建可跨越单个或多个交换机的逻辑广播域,而无需考虑物理接近度。此功能可用于减小广播域的大小,或用于在组或用户不必位于相同物理地点的情况下对组或用户进行逻辑分组。
为创建 VLAN,必须确定如何配置下列项目:
要在此交换机上使用的 VLAN Trunk Protocol (VTP) 域名及 VTP 模式
交换机上的端口与 VLAN 的从属关系
是否需要在 VLAN 之间进行通信,或者是否要将其相互隔离
如果需要在 VLAN 之间进行通信,则必须使用第三层路由设备,例如外部 Cisco 路由器或内部路由器模块。如下面的示例所示:
用于带有 Supervisor 引擎 I 和 Supervisor 引擎 II 的 Catalyst 4500/4000 交换机的 WS-X4232-Layer 3 卡
用于 Catalyst 6500/6000 交换机的 Multilayer Switch Module (MSM) 或 Multilayer Switch Feature Card (MSFC)
某些交换机在软件和硬件中内置有对 VLAN 间路由的支持功能。有了 VLAN 间路由功能,则不需要任何外部设备、模块或子卡。此类交换机的示例如下:
带有 Supervisor 引擎 720 的 Catalyst 3550/3750/6500
带有Supervisor引擎II+、Supervisor引擎III和Supervisor引擎IV的Catalyst 4500
有关 MSFC、RSM、RSFC 或外部路由器上 VLAN 间路由配置的详细信息,请参阅下列文档:
注意:本文档假设您可以通过控制台或Telnet访问与交换机建立基本连接。有关如何获得交换机基本连接的详细信息,请参阅这些文档。
本文档中的信息基于下列硬件和软件版本:
运行 Cisco IOS 软件版本 12.0(5.x)XU 的 Catalyst 3524XL 交换机
运行 Cisco IOS 软件版本 12.1(13)EW1、带有 Supervisor 引擎 IV (WS-X4515) 的 Catalyst 4507 交换机
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
本文档中的信息也可用于以下或运行Cisco IOS的其他Catalyst交换机:
Catalyst 4500/4000/2948G/2980G/4912G 交换机
Catalyst 6500/6000 系列交换机
Catalyst 2900XL/3500XL/2950/3550/3750 交换机
本文档介绍如何在运行Cisco IOS®系统软件的Catalyst交换机上创建VLAN。各部分的示例命令使用各配置部分中的一台 Catalyst 交换机。
注:您看到的输出可能与此部分显示的某些命令输出不同。不同之处取决于交换机的型号。
请完成下列步骤以创建 VLAN。
确定是否在您的网络中使用 VTP。
使用 VTP 可以在单个交换机上集中进行配置更改,并将这些更改自动传送给网络上其他所有交换机。Catalyst 2900XL、3500XL、2950、2970 和 2940 交换机的默认 VTP 模式为服务器模式。有关 VTP 的详细信息,请参阅了解 VLAN 中继协议 (VTP)。
注意:发出show vtp status命令以检查XL系列交换机上的VTP状态。
3524XL#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 254 Number of existing VLANs : 5 VTP Operating Mode : Server !--- This is the default mode. 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 0.0.0.0 at 0-0-00 00:00:00
设置并验证 VTP 域之后,即可开始在交换机上创建 VLAN。
默认情况下,所有端口只有一个 VLAN。此 VLAN 称为 default。不能重命名或删除 VLAN 1。
发出 show vlan 命令以检查 VLAN 信息。
3524XL#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 1002 1003 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 IBM - 0 0 1005 trnet 101005 1500 - - 1 IBM - 0 0
在特权模式下发出此组命令以创建另一个 VLAN:
3524XL#vlan database !--- You must enter into VLAN database in order to configure any VLAN. 3524XL(vlan)#vtp server Device mode already VTP SERVER. !--- You can skip this command if the switch is already in server mode and you
!--- want the switch to be in server mode.
注意:交换机只能在VTP服务器模式或VTP透明模式下创建VLAN。有关 VTP 的详细信息,请参阅了解 VLAN 中继协议 (VTP)。
524XL(vlan)#vlan ? <1-1005> ISL VLAN index 3524XL(vlan)#vlan 2 ? are Maximum number of All Route Explorer hops for this VLAN backupcrf Backup CRF mode of the VLAN bridge Bridging characteristics of the VLAN media Media type of the VLAN mtu VLAN Maximum Transmission Unit name Ascii name of the VLAN parent ID number of the Parent VLAN of FDDI or Token Ring type VLANs ring Ring number of FDDI or Token Ring type VLANs said IEEE 802.10 SAID state Operational state of the VLAN ste Maximum number of Spanning Tree Explorer hops for this VLAN stp Spanning tree characteristics of the VLAN tb-vlan1 ID number of the first translational VLAN for this VLAN (or zero if none) tb-vlan2 ID number of the second translational VLAN for this VLAN (or zero if none) 3524XL(vlan)#vlan 2 name ? WORD The ASCII name for the VLAN 3524XL(vlan)#vlan 2 name cisco_vlan_2 VLAN 2 added: Name: cisco_vlan_2 3524XL(vlan)#exit !--- You must exit from the VLAN database in order for the changes
!--- to be committed. APPLY completed. Exiting.... 3524XL#
注意:如果交换机尝试获取或传递的VLAN数量超过其支持的VLAN数量,则VTP模式可以从客户端模式更改为透明模式。请确保在客户端模式下运行的交换机所支持的 VLAN 数与在服务器模式下运行的交换机所发送的 VLAN 数相同。
发出 show vlan 命令以确保 VLAN 已创建。
3524XL#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2 2 cisco_vlan_2 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 1002 1003 2 enet 100002 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 IBM - 0 0 1005 trnet 101005 1500 - - 1
可以向新建的 VLAN 添加端口(接口)。
对于要添加到新 VLAN 的每个接口,您都必须进入接口配置模式。
注意:您可以将第2层Catalyst交换机的端口分配给多个VLAN,但交换机一次仅支持一个活动管理VLAN接口,并且由于第2层功能的原因,其他交换虚拟接口(SVI)不会打开/打开。因此,交换机只支持一个活动的管理第 3 层地址。在第 2 层 Catalyst 交换机上,可以在新的 SVI 下发出可选的管理命令以自动关闭 VLAN 1 并将 IP 地址传递给新的 VLAN。
Switch#configure terminal
Switch(config)#interface vlan 2
Switch(config-subif)#management
Switch(config-subif)#^Z
Switch#show ip interface brief Interface IP-Address OK? Method Status Protocol VLAN1 10.0.0.2 YES manual up down VLAN2 10.0.0.22 YES manual up up FastEthernet0/1 unassigned YES unset up up FastEthernet0/2 unassigned YES unset up up !--- Output suppressed.
在特权模式下发出此组命令以在 VLAN 中添加特定接口:
3524XL#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 3524XL(config)#interface fastethernet 0/2 3524XL(config-if)#switchport access ? vlan Set VLAN when interface is in access mode 3524XL(config-if)#switchport access vlan ? <1-1001> VLAN ID of the VLAN when this port is in access mode dynamic When in access mode, this interfaces VLAN is controlled by VMPS 3524XL(config-if)#switchport access vlan 2 !--- These commands assign interface Fast Ethernet 0/2 to VLAN 2. 3524XL(config-if)#exit 3524XL(config)#interface fastethernet 0/3 3524XL(config-if)#switchport access vlan 2 !--- These commands assign interface Fast Ethernet 0/3 to VLAN 2. 3524XL(config-if)#end 3524XL# 00:55:26: %SYS-5-CONFIG_I: Configured from console by console 3524XL#write memory !--- This saves the configuration. Building configuration...
发出 show vlan 命令以验证 VLAN 配置。
3524XL#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2 2 cisco_vlan_2 active Fa0/2, Fa0/3 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 1002 1003 2 enet 100002 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 IBM - 0 0 1005 trnet 101005 1500 - - 1 IBM - 0 0
要从 VLAN 中删除端口,请在接口配置模式下发出 no switchport access vlan vlan_number 命令。从 VLAN 1(默认 VLAN)以外的 VLAN 中将端口删除后,该端口将自动被添加回默认 VLAN。
例如,如果要从 cisco_vlan_2 (VLAN 2) 中删除快速以太网 0/2 接口,请在特权模式下发出此组命令:
3524XL#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 3524XL(config)#interface fastethernet 0/2 3524XL(config-if)#no switchport access vlan 2 !--- These two commands remove interface Fast Ethernet 0/2 from VLAN 2. 3524XL(config-if)#end 3524XL#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5, !--- Note: Fast Ethernet 0/2 is added back to the default VLAN. Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2 2 cisco_vlan_2 active Fa0/3 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 1002 1003 2 enet 100002 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 IBM - 0 0 1005 trnet 101005 1500 - - 1 IBM - 0 0
要删除 VLAN,请在 VLAN 数据库模式下发出 no vlan vlan_number 命令。该 VLAN 中的接口仍为该 VLAN 的一部分,但由于它们不再属于任何 VLAN,因此将被停用。
例如,如果要从交换机中删除 cisco_vlan_2,请在特权模式下发出此组命令:
3524XL#vlan database !--- This command enters you into the VLAN database mode. 3524XL(vlan)#no vlan 2 !--- This command removes the VLAN from the database. Deleting VLAN 2... 3524XL(vlan)#exit APPLY completed. Exiting.... 3524XL#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active !--- Output suppressed.
注意,show vlan 命令输出中不显示快速以太网 0/3 端口。VLAN 2 的删除操作已使此端口停用。此端口既不显示,也不可用,除非将其添加回另一个 VLAN 中。
3524XL#show interfaces fastethernet 0/3 FastEthernet0/3 is down, line protocol is down !--- Output suppressed.
为使接口可用,必须确保其属于某个 VLAN。在文档本部分的示例中,必须将快速以太网 0/3 接口添加到默认 VLAN (VLAN 1) 中以使此接口可用。
注:如果您有来自Cisco设备的 show-tech support命令的输出,则可以使用输出解释程序显示潜在问题和解决方法。
注意:只有思科注册用户才能访问内部工具和信息。
注:对于Catalyst 3550交换机,您仍然可以使用接口,而无需将接口添加到VLAN。但该接口需为第 3 层接口。
使用 Catalyst 2900XL/3500XL 交换机上的多 VLAN 端口功能可以在两个或多个 VLAN 中对单个端口进行配置。此功能允许来自不同 VLAN 的用户访问服务器或路由器,而无需实施 VLAN 间路由功能。多 VLAN 端口在为其分配的所有 VLAN 中执行正常的交换功能。与在中继中不同,多 VLAN 端口上的 VLAN 数据流不进行封装。
注:以下是实施多VLAN端口功能的限制:
如果交换机上配置了中继,则无法配置多 VLAN 端口。只能将多 VLAN 端口连接到路由器或服务器。启用多 VLAN 端口功能后,交换机会自动转换到 VTP 透明模式,这将禁用 VTP。VTP 配置并不是必需的。
只有 Catalyst 2900XL/3500XL 系列交换机支持多 VLAN 端口功能。Catalyst 4500/4000、5500/5000 或 6500/6000 系列交换机或其他任何 Catalyst 交换机都不支持此功能。
确定将哪个端口配置为多 VLAN 端口。
此处,在 Catalyst 3512XL 交换机上创建了三个 VLAN,且交换机的一个端口连接至外部路由器。本示例将连接到路由器的端口配置为多 VLAN 端口。
6-3512xl#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ----------------------------- 1 default active Fa0/1, Fa0/3, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Gi0/1, Gi0/2 2 VLAN0002 active Fa0/2, Fa0/4 3 VLAN0003 active Fa0/5 4 VLAN0004 active 5 VLAN0005 active 6 VLAN0006 active
在示例中,快速以太网 0/1 端口连接至外部路由器。有关如何创建VLAN和将端口分配给VLAN的详细信息,请参阅本文档的在Catalyst 2900XL、3500XL、2950、2970和2940系列交换机上配置VLAN部分。
在多 VLAN 模式下对快速以太网 0/1 端口进行配置,并将分配的 VLAN 添加到该多 VLAN 端口。
6-3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 6-3512xl(config)#interface fastethernet 0/1 6-3512xl(config-if)#switchport mode multi !--- This command changes the port Fast Ethernet 0/1 mode to multi. 6-3512xl(config-if)#switchport multi vlan ? LINE VLAN IDs of VLANs to be used in multi-VLAN mode add add VLANs to the current list remove remove VLANs from the current list 6-3512xl(config-if)#switchport multi vlan 1,2,3 !--- This command assigns VLANs 1, 2, and 3 to multi-VLAN port Fast Ethernet 0/1. 6-3512xl(config-if)#^Z 6-3512xl#
发出 show interface interface_id switchport 命令及 show vlan 命令以验证配置。
6-3512xl#show interface fastethernet 0/1 switchport Name: Fa0/1 Operational Mode: multi !--- The port is in multi-VLAN mode. 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: NONE Pruning VLANs Enabled: NONE Priority for untagged frames: 0 Override vlan tag priority: FALSE Voice VLAN: none Appliance trust: none 6-3512xl#show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ---------------------------- 1 default active Fa0/1, Fa0/3, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/1 Fa0/12, Gi0/1, Gi0/2 2 VLAN0002 active Fa0/1, Fa0/2, Fa0/4
!--- Note: Previously, port Fast Ethernet 0/1 was only in VLAN 1.
!--- Now the port is assigned to multiple VLANs 1, 2, and 3.
3 VLAN0003 active Fa0/1, Fa0/5 4 VLAN0004 active 5 VLAN0005 active
从交换机向路由器发出 ping 命令以验证多 VLAN 操作。
每当管理 IP 地址被分配给 VLAN 1、2 或 3 中任何一个的时候,ping 命令就会收到路由器的一个答复。
6-3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 6-3512xl(config)#interface vlan 1 6-3512xl(config-if)#ip address 192.168.1.1 255.255.255.0 !--- The management IP address is assigned to VLAN 1. 6-3512xl(config-if)#^Z 6-3512xl# 23:56:54: %SYS-5-CONFIG_I: Configured from console by console 6-3512xl#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/3 ms 6-3512xl#ping 192.168.1.2 !--- You can ping the router from VLAN 1. Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms 6-3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 6-3512xl(config)#interface vlan 1 6-3512xl(config-if)#no ip address !--- The management IP address is removed from VLAN 1. 6-3512xl(config-if)#shutdown 6-3512xl(config-if)#exit 6-3512xl(config)#interface vlan 2 6-3512xl(config-subif)#ip address 192.168.1.1 255.255.255.0 6-3512xl(config-subif)#no shutdown !--- The management IP address is assigned to VLAN 2. 6-3512xl(config-subif)#exit 6-3512xl(config)#exit 6-3512xl#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms 6-3512xl#ping 192.168.1.2 !--- You can ping the router from VLAN 2. Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/202/1004 ms 6-3512xl#configure terminal Enter configuration commands, one per line. End with CNTL/Z. 6-3512xl(config)#interface vlan 2 6-3512xl(config-subif)#no ip address !--- The management IP address is removed from VLAN 2. 6-3512xl(config-subif)#shutdown 6-3512xl(config-subif)#exit 6-3512xl(config)#interface vlan 3 6-3512xl(config-subif)#ip address 192.168.1.1 255.255.255.0 6-3512xl(config-subif)#no shut !--- The management IP address is assigned to VLAN 3. 6-3512xl(config-subif)#exit 6-3512xl(config)#exit 6-3512xl#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms 6-3512xl#ping 192.168.1.2 !--- You can ping the router from VLAN 3. Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/205/1004 ms
本部分使用 Catalyst 4500 交换机运行示例配置命令,但这些配置任务也适用于运行第 3 层(或 Cisco IOS 软件)的其他交换机。其他交换机包括运行 Cisco IOS 软件的 Catalyst 3550、3570 和 6500 系列交换机。在创建 VLAN 之前,交换机必须处于 VTP 服务器模式或 VTP 透明模式。如果交换机为 VTP 服务器,则在添加任何 VLAN 之前必须定义 VTP 域名。必须定义 VTP 域名,无论:
网络中交换机的数量为一个还是多个
是否使用 VTP 将 VLAN 传播到网络中的其他交换机
可以在 VLAN 数据库模式或全局配置模式下创建 VLAN。在全局配置模式下,所创建的 VLAN 的编号必须大于 1005。要创建这些 VLAN,必须将 VTP 模式设置为透明。VTP 不会对编号大于 1005 的 VLAN 进行通告。此外,编号大于 1005 的 VLAN 存储在交换机配置文件中,而不存储在 VLAN .dat 文件中。在带有 Supervisor 引擎 IV 的 Catalyst 4000 交换机中,VLAN .dat 文件的默认位置为 cat4000_flash 目录。
Switch#dir cat4000_flash: Directory of cat4000_flash:/ 1 -rw- 676 <no date> vlan.dat 524260 bytes total (523584 bytes free)
注意:运行Cisco IOS软件的Catalyst 6500交换机允许您在没有VTP域名的服务器模式下创建VLAN。
show vtp status 命令可显示交换机中的 VTP 信息。
Switch#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 8 VTP Operating Mode : Server VTP Domain Name : cisco VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0xA4 0x18 0x78 0x52 0x5A 0x1B 0x2E 0x14 Configuration last modified by 0.0.0.0 at 5-28-01 05:17:02 Local updater ID is 10.10.10.1 on interface Vl1 (lowest numbered VLAN interface)
发出 show vlan 命令以检查 VLAN 信息。
Switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi1/1, Gi1/2, Gi3/1, Gi3/2 Gi3/3, Gi3/4, Gi3/5, Gi3/6 Gi3/7, Gi3/8, Gi3/9, Gi3/10 Gi3/11, Gi3/12, Gi3/13, Gi3/14 Gi3/15, Gi3/16, Gi3/17, Gi3/18 !--- Output suppressed. VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------
进入正确的模式(数据库模式或全局配置模式)。
在特权模式下发出 vlan database 命令以进入 VLAN 数据库模式。
Switch#vlan database Switch(vlan)#
发出 vlan vlan_number 命令以配置 VLAN。
Switch(vlan)#vlan 2 VLAN 2 added: Name: VLAN0002 Switch(vlan)#apply APPLY completed.
注:要使配置生效,可以发出apply命令或退出VLAN数据库模式。end 关键字和 Ctrl-Z 退出方法在 VLAN 数据库模式下无效。发出 exit 命令以退出 VLAN 数据库模式。
发出这些命令以在全局配置模式下执行 VLAN 配置:
Switch(config)#vlan 3 Switch(config-vlan)#exit Switch(config)#
发出show run命令以查看当前运行的配置中编号大于1005的VLAN。
Switch#show running-config Building configuration... Current configuration : 2975 bytes ! version 12.1 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption service compress-config ! hostname Switch ! ! ip subnet-zero ! spanning-tree extend system-id ! redundancy mode rpr main-cpu auto-sync standard ! ! vlan 2000 ! interface GigabitEthernet1/1 ! interface GigabitEthernet1/2 ! !--- Output suppressed.
在Cisco IOS软件中,接口默认处于shutdown状态。
默认情况下,Catalyst 3550、3750 和 4500 系列交换机上的 Cisco IOS 软件接口为第 2 层接口。Catalyst 6500/6000 系列交换机上的相应接口为第 3 层接口。可以在接口配置模式下用 switchport 命令将接口配置为第 2 层接口。如果接口处于第 3 层模式,则必须在将接口分配给 VLAN 之前发出此命令。将接口分配给 VLAN 的命令为 switchport access vlan vlan_number。
注:如果接口配置为第3层接口(这意味着配置了no switchport命令),则不能将该接口分配给VLAN。
要在 Cisco IOS 软件中将端口关联至 VLAN,需要此最低配置:
Switch(config)#interface gigabitethernet 3/1 Switch(config-if)#switchport !--- This command is required if the interface is in Layer 3 mode. Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shutdown
发出show interface gigabitethernet module interface switchport命令以检查第2层接口状态。
Switch#show interface gigabitethernet 3/1 switchport Name: Gi3/1 Switchport: Enabled Administrative Mode: dynamic auto Operational Mode: static access Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: native Negotiation of Trunking: On Access Mode VLAN: 2 (VLAN0002) 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 Voice VLAN: none (Inactive) Appliance trust: none
如果端口被设为中继(可承载一个以上 VLAN 的端口),则可使用 switchport trunk native vlan 命令。如果已更改或需要更改接口的本地 VLAN 的默认设置,此命令很有用。本地 VLAN 指的是在接口成为第 2 层接口时使用的 VLAN。如果没有明确定义本地 VLAN,默认情况下 VLAN 1 将成为本地 VLAN。请注意,数据在本地 VLAN 上进行发送时,不会添加 IEEE 802.1Q 报头。请确保两个连接设备上的中继端口具有相同的本地 VLAN。本地 VLAN 不匹配可能会导致 VLAN 间路由问题,以及其他问题。
如果两台 Cisco 交换机上的本地 VLAN 不匹配,将显示此消息:
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEhernet1/1 (2), with D-R3550-9B GigabitEthernet0/1 (1)
在本示例消息中,其中一台交换机上的本地 VLAN 为 VLAN 2,但相邻交换机上的本地 VLAN 则为 VLAN 1。
发出show interfaces module interface trunk命令以查看本征VLAN、封装和中继VLAN信息。
Switch#show interfaces gigabitethernet 3/1 trunk Port Mode Encapsulation Status Native vlan Gi3/1 on 802.1q trunking 1 Port Vlans allowed on trunk Gi3/1 1-4094 Port Vlans allowed and active in management domain Gi3/1 1-4,2000,3000 Port Vlans in spanning tree forwarding state and not pruned Gi3/1 none
如果使用默认配置,本征VLAN将设置为VLAN 1。要更改中继接口上的本地VLAN,请发出switchport trunk native vlan vlan_number命令。
Switch(config)#interface gigabitethernet 3/1 Switch(config-if)#switchport trunk native vlan 2
发出此命令以进行验证:
Switch#show interfaces gigabitethernet 3/1 trunk Port Mode Encapsulation Status Native vlan Gi3/1 on 802.1q trunking 2 Port Vlans allowed on trunk Gi3/1 1-4094 Port Vlans allowed and active in management domain Gi3/1 1-4,2000,3000 Port Vlans in spanning tree forwarding state and not pruned Gi3/1 none
可以将交换机上的多个接口分配给单个 VLAN。发出以下命令:
Switch(config)#interface range fastethernet [mod/slot - mod/slot]
Switch(config-if-range)#switchport access vlan vlan_number
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#no shut
注意:并非所有软件版本都支持interface range命令。Cisco IOS软件版本12.1(13)EW及更高版本支持 interface range命令。
要从 VLAN 数据库中删除 VLAN,请在 VLAN 数据库模式或全局配置模式下发出 no vlan vlan_number 命令。本示例使用 VLAN 数据库模式删除 VLAN 2。
Switch#vlan database Switch(vlan)#no vlan 2 Deleting VLAN 2... Switch(vlan)#apply APPLY completed.
全局配置模式不会在控制台上记录指示 VLAN 删除的任何消息。但您可以发出 show vlan 命令以验证 VLAN 是否删除。
要在 VLAN 数据库中重命名 VLAN,请在 VLAN 数据库模式或全局配置模式下发出 name vlan_name 命令。
本示例使用 VLAN 数据库模式重命名 VLAN 3:
Switch#vlan database
Switch(vlan)#vlan 3
Switch(vlan)#name CISCO
Switch(vlan)#apply
APPLY completed.
本示例使用全局配置模式重命名 VLAN 3:
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(vlan)#vlan 3
Switch(vlan)#name CISCO
要进行验证,请发出 show vlan brief 或 show vlan-switch brief 命令。
switch#show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ----------- 3 CISCO active Fa0/3
注意:重命名VLAN时,不需要使用switchport access vlan vlan_number命令删除分配给端口的VLAN。
本部分不讨论专用 VLAN。专用 VLAN 在同一专用 VLAN(隔离的 VLAN)内的不同端口之间或在不同专用 VLAN(社区 VLAN)之间提供第 2 层隔离。
有二种方案可用于对两个 VLAN 进行隔离。
第 2 层 VLAN 是创建于交换机中、但没有使用 interface vlan <vlan_number> 命令进行配置的 VLAN。不同的第 2 层 VLAN 中的主机彼此之间无法进行通信。
完成下列步骤以创建第 2 层 VLAN 并将其与旧的 VLAN 进行隔离:
在数据库中创建新 VLAN。退出 VLAN 数据库模式时,将会应用配置更改。
Switch#vlan database !--- You must enter into VLAN database mode in order to
!--- configure any VLAN. Switch(vlan)#vlan 5 VLAN 5 added: Name: VLAN0005 Switch(vlan)#vlan 6 VLAN 6 added: Name: VLAN0006 Switch(vlan)#exit APPLY completed. Exiting....
确保已在VLAN数据库中创建VLAN。新 VLAN 必须显示在 show vlan 命令的输出中。
请勿为新建的 VLAN 设置 IP 地址。
配置连接客户端和相应 VLAN 的物理接口。
Switch(config)#interface fastEthernet 2/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 5 Switch(config-if)#no shut witch(config)#interface fastEthernet 2/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 6 Switch(config-if)#no shut
为每台主机分配一个静态 IP 地址和子网掩码。请勿设置默认网关。这会造成端口 fa 2/1 和 2/2 上的主机彼此之间无法通信。属于同一 VLAN 的设备只能到达相同 VLAN 内的设备,而不会到达其他任何设备。
创建 VLAN 并使用 interface vlan <vlan_number> 命令分配 IP 地址后,该 VLAN 即成为第 3 层 VLAN。在第 3 层交换机中,(如果配置主机以使用默认网关作为 VLAN 接口 IP 地址)两 VLAN 中的主机彼此间可以通信。可以使用 ACL 拒绝 VLAN 之间的通信。
本部分展示了如何隔离新建的第 3 层 VLAN 和旧 VLAN 的通信的示例。
在本示例中,3750 交换机中有两个旧 VLAN(VLAN 1 和 VLAN 2)。新创建的VLAN是VLAN 5。VLAN 1、VLAN 2和VLAN 5是第3层VLAN。通过实施 ACL 来拒绝流量,从而使 VLAN 1 和 VLAN 2 无法与 VLAN 5 通信,且 VLAN 5 也无法与 VLAN 1 或 VLAN 2 通信。
VLAN 1 - 10.10.10.0 /24
VLAN 2 - 172.16.1.0 /24
VLAN 5 - 192.168.1.0 /24
在数据库中创建新 VLAN。在本例中,新的VLAN是VLAN
5.退出VLAN数据库模式时,将应用配置更改。Switch#vlan database !--- You must enter into VLAN database mode
!--- in order to configure any VLAN. Switch(vlan)#vlan 5 VLAN 5 added: Name: VLAN0005 Switch(vlan)#exit APPLY completed. Exiting....
确保已在VLAN数据库中创建VLAN。查看 show vlan 命令的输出。
为新建的 VLAN 设置 IP 地址。
Switch(config)#interface vlan 5 Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config)#no shut
配置连接客户端和相应 VLAN 的物理接口。
Switch(config)#interface fastEthernet 2/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 5 Switch(config-if)#no shut
需要配置三个访问列表,每个 VLAN 一个。
此访问列表拒绝从 VLAN 1 到 VLAN 5 的流量。
!--- Some of the commands in this output are wrapped
!--- to a second line due to spatial reasons. Switch#configure terminal Switch(config)#access-list 101 deny ip 10.10.10.0 0.0.0.255 192.168.1.0 0.0.0.255 Switch(config)#access-list 101 permit ip 10.10.10.0 0.0.0.255 any
此访问列表拒绝从 VLAN 2 到 VLAN 5 的流量。
Switch#configure terminal Switch(config)#access-list 102 deny ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255 Switch(config)#access-list 102 permit ip 172.16.1.0 0.0.0.255 any
此访问列表拒绝从 VLAN 5 到 VLAN 1 和 VLAN 2 的流量。
Switch#configure terminal Switch(config)#access-list 105 deny ip 192.168.1.0 0.0.0.255 10.10.10.0 0.0.0.255 Switch(config)#access-list 105 deny ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255 Switch(config)#access-list 105 permit ip 192.168.1.0 0.0.0.255 any
配置完成后,将访问列表应用于 VLAN 1 接口、VLAN 2 接口及 VLAN 5 接口。
Switch#configure terminal Switch(config)#interface vlan 1 Switch(config-if)#ip access-group 101 in Switch(config-if)#exit Switch#configure terminal Switch(config)#interface vlan 2 Switch(config-if)#ip access-group 102 in Switch(config-if)#exit Switch#configure terminal Switch(config)#interface vlan 5 Switch(config-if)#ip access-group 105 in Switch(config-if)#end
要在运行Cisco IOS的Catalyst 6500系列交换机上配置扩展VLAN,需要输入spanning-tree extend system-id命令。然后,必须在配置模式下创建扩展的 VLAN,而非 vlan 数据库模式。
完成下列步骤以在运行 Cisco IOS 的 Catalyst 6500 系列交换机上配置扩展的 VLAN:
通过控制台连接登录交换机:
Switch>enable Switch#
进入配置模式:
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#
在配置模式下输入 spanning-tree extend system-id 命令:
Switch(config)#spanning-tree extended system-id
在配置模式下输入 vtp mode transparent 命令:
Switch(config)#vtp mode transparent
在配置模式下创建 VLAN:
Switch(config)#vlan 1311 Notice Switch(config-vlan)#exit
退出配置模式:
Switch(config)#exit
发出 show vlan 命令以检查 VLAN 信息。
Switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active 101 VLAN0101 active Gi4/8, Gi4/10 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup 1311 VLAN1311 active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 101 enet 100101 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 1311 enet 101311 1500 - - - - - 0 0
本部分提供了一些技巧,用于排除在运行Cisco IOS软件的Catalyst交换机上创建VLAN时可能遇到的常见问题。
在运行 Cisco IOS 软件的交换机上,可以使用交换机本身实现 VLAN 间路由,而无需外部路由器。创建 SVI 后,并不会在第 2 层数据库中自动创建 VLAN。为激活 SVI,必须在 VLAN 数据库模式或(Cisco IOS 软件的较新版本中的)全局配置模式下创建 VLAN。要使SVI完全处于活动状态(即处于管理性开启状态,且线路协议处于开启状态),请确保至少有一个端口作为该VLAN的成员,且有活动设备连接到该端口。
从其他交换机复制配置时,或恢复配置(在该配置中,VLAN 是在 VLAN 数据库模式下创建的)时,同样的问题也适用。此外还必须替换 VLAN 数据库文件 (vlan.dat),或按照本文档中的创建 VLAN 和端口部分所示的程序重新创建 VLAN。从另一台交换机复制配置时,不会复制 VLAN 数据库。
如果没有在交换机上创建第 2 层 VLAN,则将配置应用于交换机时,SVI 接口在 show ip interface brief 命令输出中将显示为 UP/DOWN。请确保在将配置复制到交换机后,之前在 VLAN 数据库模式或全局配置模式下创建的所有 VLAN 仍然存在。
当前没有可用于此配置的验证过程。
对于运行Cisco IOS软件的Cisco Catalyst交换机,VLAN信息位于名为 vlan.dat的单独文件中。如果 vlan.dat 文件被意外删除,且交换机进行了重新加载,则交换机上的所有可用 VLAN 将会丢失。在交换机重新加载之前,VLAN 信息一直存在于交换机上。
完成下列步骤以恢复 vlan.dat 文件:
发出 show vlan 命令以确认 VLAN 信息的可用性。
Switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/10, Fa0/11, Fa0/12, Gi0/1 Gi0/2 10 VLAN0010 active 11 VLAN0011 active 20 VLAN0020 active 21 VLAN0021 active 30 VLAN0030 active 31 VLAN0031 active 40 VLAN0040 active 41 VLAN0041 active 50 Vlan50 active 100 100thVLAN active
如果交换机处于 VTP 服务器或透明模式,则可以对 VLAN 数据库进行任意修改。
可以对 VLAN 数据库进行以下任意修改:
创建任意 VLAN。
删除任意 VLAN。
修改任何当前 VLAN 的属性。
如果交换机处于 VTP 客户端模式,则可以在同一域内的任意 VTP 服务器上对 VLAN 数据库进行修改。
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 50 Switch(config-vlan)#name 50thVLAN Switch(config-vlan)#end Switch#
对 VLAN 数据库进行任何更改后,交换机会自动创建 vlan.dat 文件。
发出show flash:命令以验证是否创建了vlan.dat文件。
Switch#show flash: Directory of flash:/ 2 -rwx 5 Mar 01 1993 00:04:47 private-config.text 3 -rwx 2980487 Mar 02 1993 06:08:14 c2950-i6q4l2-mz.121-19.EA1a.bin 4 -rwx 1156 Mar 01 1993 01:51:27 vlan.dat 16 -rwx 1014 Mar 01 1993 00:04:47 config.text 6 drwx 4096 Mar 02 1993 03:49:26 html 7 -rwx 3121383 Mar 02 1993 03:47:52 c2950-i6q4l2-mz.121-22.EA9.bin 7741440 bytes total (65536 bytes free)
% Failed to create VLANs [dec] VLAN(s) not available in Port Manager.
第 3 层 LAN 端口、WAN 接口和子接口及某些软件功能(例如 RSPAN)在使用扩展范围的内部 VLAN。您不能使用分配给内部使用的扩展范围 VLAN。
要显示内部使用的 VLAN,请发出 show vlan internal usage 命令。您可以配置升序形式的内部 VLAN 分配(从 1006 往上)或降序形式的内部 VLAN 分配(从 4094 往下)。
Switch(config)#vlan internal allocation policy {ascending | descending} !--- Enter the ascending keyword to allocate internal VLANs from 1006 and up.
!--- Enter the descending keyword to allocate internal VLAN from 4094 and down.
Switch(config)#end Switch#reload
注意:您无需立即发出reload命令。可在计划维护时段内发出 reload 命令。重新加载后方可应用内部 VLAN 分配策略。
如果重新加载设备并非可考虑的选项,则可以使用 VLAN 转换作为替代办法。在中继端口上,可以将一个 VLAN 编号转换为另一个 VLAN 编号,这会将一个 VLAN 收到的所有流量传输给另一个 VLAN。请参阅配置VLAN转换 有关详细信息,请参阅Catalyst 6500版本12.2SXF和重建软件配置指南部分。
注:运行Catalyst产品系列软件的交换机不支持VLAN 1006-1024的配置。如果要配置 VLAN 1006-1024,请确保 VLAN 不会扩展到运行 Catalyst 产品系列软件的任何交换机。
%Failed to commit extended VLAN(s) changes
当您尝试在VTP的服务器模式或客户端模式下创建扩展VLAN时,您会收到此消息。 创建扩展范围的VLAN时,请确保设备(交换机或路由器)处于透明模式
SW-VLAN-4-BAD-STARTUP-VLAN-CONFIG-FILE: Failed to configure VLAN from startup-config. Fallback to use VLAN configuration file from non-volatile memory
此消息表明 VLAN 软件无法使用启动配置文件中的 VLAN 配置。VLAN 配置存储在 vlan.dat 文件中。vlan.dat 文件驻留在非易失性存储器中。如果替换了 Supervisor 模块,则 vlan.dat 为空 (0)。启动时,交换机将对启动配置文件和 vlan.dat 文件中的 VTP 域名和 VTP 模式进行比较。如果其值不匹配,则交换机将使用 vlan.dat 文件中的配置。
要对配置执行完全备份,vlan.dat 文件必须与配置一起包含在备份中。网络管理员必须同时上载 vlan.dat 文件和配置文件以便恢复完整配置。
要备份vlan.dat,请完成以下步骤:
将vlan.dat文件从设备NVRAM复制到TFTP服务器或外部PCMCIA卡。
copy const_nvram:vlan.dat tftp:
注:存储vlan.dat文件的内存位置因设备而异。Cisco Catalyst 6500/6000 系列交换机中的存储位置为 const_nvram:。类似于Catalyst 4500/4000交换机,它是cat4000_flash:。发出copy命令之前,请参阅相应的产品文档
要恢复 vlan.dat 文件,请完成下列步骤:
将vlan.dat文件从TFTP服务器或外部PCMCIA卡复制到设备NVRAM。
copy tftp: const_nvram:
请重新加载交换机,因为 vlan.dat 只会在启动过程中被读取。
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 102 Switch(config-vlan)#name marketing Switch(config-vlan)#exit VLAN 1003 parent VLAN missing APPLY VLAN changes failed. Switch(config)#end Switch#
交换机中的错误配置可能会造成 VTP 配置更新失败。多数情况下,问题在于在 VTP 服务器交换机上创建的新 VLAN 没有传播给 VTP 客户端交换机,从而产生主机连接问题。
此问题的一个常见原因是,VTP 域内的交换机之间的 VTP 版本不匹配。在同一 VTP 域内的网络设备上,VTP 版本 1 和 VTP 版本 2 无法进行互操作。对于支持 VTP 版本 2 的网络设备,在禁用 VTP 版本 2 的前提下,该设备可以实现对运行 VTP 版本 1 的网络设备的操作。VTP 版本 2 默认为禁用。VTP 域中的每台网络设备必须使用相同的 VTP 版本。对交换机上运行的 VTP 版本进行验证。如果 VTP 版本 2 处于启用状态,请将其禁用以解决此问题。
验证交换机上的其他 VTP 参数是否配置正确:
由于 VTP 更新只能通过中继链路进行交换,请确保交换机通过中继链路进行连接。
确保相应交换机上的 VTP 域名完全相同。名称区分大小写。VTP 更新只能在同一 VTP 域内的交换机之间进行交换。
确保域内所有交换机的 VTP 口令完全相同。口令区分大小写。如果配置了口令,则必须在域内所有交换机上配置口令,且口令必须相同。
若发生 VTP 收敛问题(VTP 客户端不更新 VLAN 信息),解决方法是在 VTP 服务器上创建假 VLAN,然后将其删除,以强制进行 VTP 收敛。该方法会增加修订版号并迫使所有 VTP 客户端更新其 VLAN 数据库。
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
27-Nov-2001 |
初始版本 |