思科VTP简单实验

实验如上图所示 所有PC默认配置IP地址

命令注解

语法格式

vtp domain <域名>                                                      // 配置vtp域名
vtp password <密码>                                                   //配置vtp密码
vtp version <1/2>                                                        // 配置vtp版本 分 1 和 2
vtp mode    <client/server/transparent>                    // 配置vtp模式 总共有3种
  client       客户模式 只能接收VLAN
  server       服务模式 通过管理VLAN 给客户端下发VLAN
  transparent  透明传输模式  只做传输不接收VLAN

注意VTP在相同域名且相同密码才能建立连接,并且必须包含一个服务端!

配置信息

SW_Core 配置

Switch(config)#hostname SW_Core
SW_Core(config)#vtp domain abc.com   //设置域名
SW_Core(config)#vtp password 123     // 设置密码
SW_Core(config)#vtp version 2            // 设置版本
SW_Core(config)#vtp mode server       //  设置模式

// 接口配置
SW_Core(config-if-range)#switchport trunk encapsulation dot1q      // 封装接口
SW_Core(config-if-range)#switchport mode trunk     // 设置trunk模式

SW1配置

Switch(config)#hostname SW1
SW1(config)#vtp domain abc.com   //设置域名
SW1(config)#vtp password 123     // 设置密码
SW1(config)#vtp mode client       //  设置模式

注意 VTP在客户模式下不能设置版本

// 接口配置
SW1(config)#int fa0/2
SW1(config-if)#switchport access vlan 10

SW1(config)#int fa0/3
SW1(config-if)#switchport access vlan 20

SW1(config)#int fa0/1
SW1(config-if)#switchport mode trunk

SW2配置

配置可参考SW1的配置

Switch(config)#hostname SW2
SW2(config)#vtp domain abc.com   //设置域名
SW2(config)#vtp password 123     // 设置密码
SW2(config)#vtp mode client       //  设置模式

注意 VTP在客户模式下不能设置版本

// 接口配置
SW2(config)#int fa0/2
SW2(config-if)#switchport access vlan 10

SW2(config)#int fa0/3
SW2(config-if)#switchport access vlan 20

SW2(config)#int fa0/1
SW2(config-if)#switchport mode trunk

验证配置

在SW1上查看VTP的信息


SW1#show vtp status    // 查看VTP信息
VTP Version capable             : 1 to 2
VTP version running             : 2     // 版本
VTP Domain Name                 : abc.com  // 域名
VTP Pruning Mode                : Disabled
VTP Traps Generation            : Disabled
Device ID                       : 000D.BD5C.9B00
Configuration last modified by 0.0.0.0 at 3-1-93 00:09:55

Feature VLAN : 
--------------
VTP Operating Mode                : Client   // 模式
Maximum VLANs supported locally   : 255
Number of existing VLANs          : 7
Configuration Revision            : 11
MD5 digest                        : 0x76 0x70 0x95 0xFC 0xA8 0xB8 0x67 0xE6 
                                    0x7A 0x54 0xD8 0xA1 0xD1 0x3B 0x1D 0xCA 

在SW_Core 上创建VLAN 10 和 20

SW_Core(config)#vlan 10
SW_Core(config)#vlan 20
SW_Core(config)#int vlan 10
SW_Core(config)#int vlan 20

回到SW1上查看是否接收到服务端创建的VLAN

同样的在SW2上查看

以上为所有配置内容

发表评论