VTP version3 理论.note
以下是 VTP 版本 3 的一些新增功能:
- VTP 主服务器:只有主服务器才能创建/修改/删除 VLAN。这是一个很大的变化,因为您不能再像使用 VTP 版本 1 或 2 那样“意外”擦除所有 VLAN。
1.
- 扩展 VLAN:您现在可以同步扩展 VLAN 范围 (1006 – 4094) 中的 VLAN。
1.
- 专用 VLAN:如果您有配置为专用 VLAN 的 VLAN,则可以将它们与 VTPv3 同步。
1.
- RSPAN VLAN:现在可以同步远程 SPAN VLAN。
1.
- MST支持:MST的问题之一是您必须手动配置每个交换机。使用 VTPv3,MST 配置将同步。
1.
- 身份验证改进:VTPv3 具有更安全的身份验证方法。
1.
- VTP 模式关闭:如果您不想将VTP用于版本1或2,则必须使用透明模式。VTPv3 可以全局禁用,也可以按接口禁用。
1.
- 兼容性:VTP 版本 3 与版本 2 兼容,而不是版本 1。
1.
我将引导您完成其中的每一个,并向您展示如何配置 VTP 版本 3。我将使用以下拓扑:

交换机之间的所有接口都配置为中继。
配置
基本配置
首先,我们将尝试在其中一个交换机上启用 VTP 版本 3:
SW1(config)#vtp version 3
Cannot set the version to 3 because domain name is not configured域名现在是一项要求,不能为空。让我们设置一个并重试:
SW1(config)#vtp domain NWL
Changing VTP domain name from NULL to NWL
%SW_VLAN-6-VTP_DOMAIN_NAME_CHG: VTP domain name changed to NWL.
SW1(config)#vtp version 3
让我们在 SW2 和 SW3 上做同样的事情:
SW2 & SW3#
(config)#vtp domain NWL
(config)#vtp version 3默认情况下,所有交换机都将在 VTP 服务器模式下运行:
SW1#show vtp status | include Operating Mode
VTP Operating Mode : ServerSW2#show vtp status | include Operating Mode
VTP Operating Mode : ServerSW3#show vtp status | include Operating Mode
VTP Operating Mode : Server但是,作为 VTP 服务器不足以更改 VLAN 数据库,请查看以下内容:
SW1(config)#vlan 100
VTP VLAN configuration not allowed when device is not the primary server for vlan database.这是新的,其中一个交换机必须是主服务器才能创建/修改或删除VLAN。让我们让 SW1 成为我们的主服务器:
SW1#vtp primary
This system is becoming primary server for feature vlan
No conflicting VTP3 devices found.
Do you want to continue? [confirm]
%SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: 0019.569d.5700 has become the primary server for the VLAN VTP feature一旦我将SW1作为主服务器,您还将在其他交换机上看到此消息:
SW2 & SW3#
%SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: 0019.569d.5700 has become the primary server for the VLAN VTP featureSW1 现在是主服务器。我们可以从 SW1 或 VTP 域中的任何其他交换机进行验证:
SW1#show vtp status | include Primary
VTP Operating Mode : Primary Server
Primary ID : 0019.569d.5700SW2#show vtp status | include Primary
Primary ID : 0019.569d.5700
Primary Description : SW1SW3#show vtp status | include Primary
Primary ID : 0019.569d.5700
Primary Description : SW1SW2 和 SW3 能够确认 SW1 是主服务器。VTP 版本 3 还有一个新命令,允许我们查看同一 VTP 域中的所有交换机:
SW1#show vtp devices
Retrieving information from the VTP domain. Waiting for 5 seconds.
VTP Feature Conf Revision Primary Server Device ID Device Description
------------ ---- -------- -------------- -------------- ----------------------
VLAN No 6 0019.569d.5700 0011.214e.d180 SW3
VLAN No 6 0019.569d.5700 0011.bb0b.3600 SW2您可以在任何交换机上运行此命令,它将显示所有 VTP 成员(而不仅仅是像 CDP 那样直接连接的成员)。
让我们看看我们是否能够同步一些 VLAN。我们将从简单的事情开始:
SW1(config)#vlan 100
SW1(config-vlan)#exit让我们创建VLAN 100,它应该显示在SW2和SW3上:
SW2 & SW3#show vlan | include VLAN0100
100 VLAN0100 active来了!我们还可以同步扩展范围(1006 – 4094)中的VLAN。让我们试一试:
SW1(config)#vlan 1234
SW1(config-vlan)#exit让我们验证它是否已同步:
SW1, SW2 & SW3#show vlan | include VLAN1234
1234 VLAN1234 active完全没有问题!让我们看一些更高级的东西。
专用虚拟局域网
SW1(config)#vlan 501
SW1(config-vlan)#private-vlan community
SW1(config)#vlan 502
SW1(config-vlan)#private-vlan isolated
SW1(config)#vlan 500
SW1(config-vlan)#private-vlan primary
SW1(config-vlan)#private-vlan association add 501
SW1(config-vlan)#private-vlan association add 502我们将创建具有两个 VLAN 的 VLAN 500。VLAN 501 是社区 VLAN,VLAN 502 是隔离的 VLAN。让我们看看它是否出现在SW1上:
SW1#show vlan private-vlan
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
500 502 isolated
501 community好了,现在让我们检查它是否已同步到 SW2 和 SW3:
SW2 & SW3#show vlan private-vlan
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
500 502 isolated
501 community我们在SW2和SW3上看到了完全相同的东西。这是对 VTPv3 的一个很好的补充。
远程跨度 (RSPAN)
RSPAN VLAN 也是一种特殊的 VLAN “类型”。它们现在可以与 VTP 同步。下面是一个示例:
SW1(config)#vlan 600
SW1(config-vlan)#remote-span
SW1(config-vlan)#exit让我们检查一下它在我们的交换机上是否可用:
SW1#show vlan remote-span
Remote SPAN VLANs
------------------------------------------------------------------------------
600SW2#show vlan remote-span
Remote SPAN VLANs
------------------------------------------------------------------------------
600SW3#show vlan remote-span
Remote SPAN VLANs
------------------------------------------------------------------------------
600没问题,它已同步到所有交换机。
MST(多生成树)
SW1#show vtp status
VTP Version capable : 1 to 3
VTP version running : 3
VTP Domain Name : NWL
VTP Pruning Mode : Disabled
VTP Traps Generation : Disabled
Device ID : 0019.569d.5700
Feature VLAN:
--------------
VTP Operating Mode : Primary Server
Number of existing VLANs : 12
Number of existing extended VLANs : 1
Configuration Revision : 7
Primary ID : 0019.569d.5700
Primary Description : SW1
MD5 digest : 0xC9 0x25 0xB3 0x86 0xE7 0xA1 0xE3 0xAE
0xF8 0x2F 0xB9 0x7F 0x64 0xB3 0x43 0x5F
Feature MST:
--------------
VTP Operating Mode : Transparent
Feature UNKNOWN:
--------------
VTP Operating Mode : Transparent默认的“VLAN”功能用于我们之前做过的事情......VLAN、扩展范围 VLAN、专用 VLAN 和 RSPAN。要同步MST信息,我们必须使用“MST”功能。如您所见,此功能的 VTP 模式当前是透明的。
就像 VLAN 功能一样,我们需要一个将创建 MST 配置的主服务器。您可以为此角色使用相同的开关,也可以选择另一个开关。为了演示这一点,我将把 SW2 作为我的主服务器:
SW2(config)#vtp mode server mst
Setting device to VTP Server mode for MST.首先,我将 SW2 从透明模式更改为服务器模式。现在我们可以将其设置为主要:
SW2#vtp primary mst
This system is becoming primary server for feature mst
No conflicting VTP3 devices found.
Do you want to continue? [confirm]
%SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: 0011.bb0b.3600 has become the primary server for the MST VTP feature此消息也将显示在 SW1 和 SW3 上:
SW1 & SW3#
%SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: 0011.bb0b.3600 has become the primary server for the MST VTP feature好的,太好了,现在看看 VTP 状态输出:
SW2#show vtp status | begin Feature MST
Feature MST:
--------------
VTP Operating Mode : Primary Server
Configuration Revision : 1
Primary ID : 0011.bb0b.3600
Primary Description : SW2
MD5 digest : 0xE1 0xFE 0x40 0x19 0x4C 0x47 0x4D 0xA5
0x9C 0x45 0x67 0xE3 0x9C 0xA3 0x92 0xEB您可以看到此交换机现在是 MST 功能的主服务器。让我们让SW1和SW3成为我们的客户:
SW1 & SW3
(config)#vtp mode client mst
Setting device to VTP Client mode for MST.