VTP(VLAN Trunking Protocol)详解

Notes:

  1. VTP 不生成 trunk 接口,但是需要 trunk links 来发送同步信息
  2. VTP 只同步 switch 中的 vlan database,不同步连接该 vlan 下的PC端接口信息,需要手动配置
  3. VTP 配置保存在 vlan.dat 中
  4. Well-known Multicast Address - CDP/VTP

VTP Revision Number

每当同一域名 domain 下的交换机发生 VLAN 的改变,如添加、删除、重命名 VLAN,该 VTP revision number 自动加 1。

当 VLAN 变化时:

  1. VTP server 首先发送 VTP summary advertisement 到该域名下的所有交换机;
  2. 各个交换机接收后发送 advertisement request 至该 VTP server 请求改变;
  3. 最后 VTP server 发送 subset advertisement 到各交换机上修改 VLAN 信息。

Notes:具体参考 VTP Messages。

VTP Domain(域名)

VTP 默认 domain 为 NULL,所有 NULL domain 的交换机不处于同一 domain 下,相互之间不同步信息。但当 NULL domain 的交换机接收到其他交换机发送的同步请求时,该NULL domain 交换机会自动加入该 domain。

手动设置 VTP domain 如下:
switch(config)# vtp domain cisco

VTP Messages

- Summary Adertisement

  1. 默认每 5s 发送一次请求,或当 VLAN 有变化时;
  2. 通报同 domain 下的其他交换机新的 VTP revision number。

- Summary/Advertisement Request

  1. 当交换机重启时;
  2. 当 VTP domain 发生变化时;
  3. 当该交换机接收到有更高 revision number 的 VTP summary advertisement

- Subset Advertisement(VLAN database 的具体变化信息)

  1. 包含 VLAN 信息列表
  2. 当有多于一个 VLAN 时,需要请求 Subset Advertisement

四类 VTP Modes

- VTP Server - Default

  1. Create/modify/delete VLANs; // 创建、修改、删除 VLAN
  2. Synchronizes local database; // 同步本地 database
  3. Save the VLAN configuration information. // 保存 VLAN 配置信息

- VTP Client

  1. 不能创建、修改、删除 VLANs;
  2. 可以发送、接收 advertisement;
  3. 同步 database.

! ! ! Notes:
当 client 的 revision number 高于同 domain 下的其他 servers 时,client 可以 override servers 中的 VLAN 信息 (高危!!!)
将交换机接入 domain 时,为避免此情况,正确做法如下:
a. 将 VTP mode 设为 transparent 模式;
b. 增加、修改、删除 VLANs;
b. 将 VTP mode 调整为 cliend 模式,接入 VLAN 域中。
原因: 透明模式下 VTP revision number 为 0,永远比 domain 中的其他交换机要低,所以不会污染其他交换机中的 VLANs 配置信息。

- VTP Transparent

  1. 不参与 VTP 配置;
  2. 不发送、接收 advertisement 到其他交换机或本地交换机;
  3. 不同步 VLAN 配置信息。
    Note: VTP version 2 中,透明模式会发送在其 trunk 端口接收到的 VTP advertisements

- Off Mode

功能与透明模式相同,但是不发送 VTP advertisement。

VTP Version

- Version 1 & 2 (default by version 1)

Standard VLANs (1 - 1005):

  1. VLAN 1 reserved for Ethernet;
  2. VLANs 1002 - 1005 reserved for FDDI & token ring .

- Version 3

Extented VLANs (1006 - 4094):
需要配置扩展 VLANs 时,VTP 必须处于 Transparent 模式下,且交换机必须为三层交换机。

VTP Pruning

为了防止交换机在接收到某一 VLAN 数据后泛洪到同一 domain 下其他所有交换机中,通过在 VTP server 上设置 VTP pruning,可使得 trunk 接收端交换机直接将该数据传送到对应的 VLAN 中。

VTP pruning 只能在 VTP server 模式下使用,且只作用于 standard VLANs(1-1005)。

常用命令

switch# show vtp status

switch(config)# vtp mode client/server/transparent // 三种vtp模式
switch(config)# vtp version 1/2/3 // 一般使用 version 2

猜你喜欢

转载自blog.csdn.net/HelloMos/article/details/84868842
VTP