实验目的

理解交换机VTP协议,实现VTP配置

实验环境

Windows 2003 XP3操作系统、cisco模拟器

相关知识

VTP,vlan trunking protocol,是Cisco的专用协议,大多数交换机都支持该协议。VTP负责在VTP域内同步VLAN信息,这样就不必在每个交换上配置相同的VLAN信息。VTP还提供一种映射方案,以便通信流能跨越混合介质的骨干。VTP最重要的作用是,将进行变动时可能会出现在的配置不一致性降至最低。不过,VTP也有一些缺点,这些缺点通常都与生成树协议有关。

实验过程

1.配置交换机A为服务器模式,并配置1端口为trunk模式

SwitchA#config t
Enter configuration commands, one per line.  End with CNTL/Z.
SwitchA(config)#vtp domain test
Domain name already set to test.
SwitchA(config)#vtp mode server
Device mode already VTP SERVER.
SwitchA(config)#vtp password 123
Password already set to 123
SwitchA(config)#interface fa 0/1
SwitchA(config-if)#switchport trunk encapsulation dot1q
SwitchA(config-if)#switchport mode trunk
SwitchA(config-if)#exit
SwitchA(config)#exit
SwitchA#
%SYS-5-CONFIG_I: Configured from console by console

tplink交换机vlan如何设置 tp交换机vlan配置_网络工程


tplink交换机vlan如何设置 tp交换机vlan配置_不一致性_02


2. 配置交换机B为客户机模式,并配置1端口为trunk模式

tplink交换机vlan如何设置 tp交换机vlan配置_tplink交换机vlan如何设置_03


3. 在交换机A上建立3个vlan并分别将其命名为vlan 11,vlan22,vlan33

tplink交换机vlan如何设置 tp交换机vlan配置_Server_04


4. 在交换机B上show vlan

tplink交换机vlan如何设置 tp交换机vlan配置_服务器_05


5. 在交换机A上删除vlan 11,并将vlan 22重命名为test 22,并查看vlan

tplink交换机vlan如何设置 tp交换机vlan配置_服务器_06


tplink交换机vlan如何设置 tp交换机vlan配置_Server_07


6. 在交换机B上查看vlan

tplink交换机vlan如何设置 tp交换机vlan配置_服务器_08

实验结果表明,调整交换机A的vlan,交换机B可以学习到vlan,证明交换机A、B上VTP协议正常运行

反思与总结

创建VTP域命令			switch(config)#vtp domain DOMAIN_NAME  
配置交换机的VTP模式	switch(config)# vtp mode server | client | transparent   
配置VTP密码			switch (config) # vtp password PASSWORD  
查看VTP配置信息		switch# show vtp status
VTP的三种模式
  • Server模式:提供VTP消息(包括VLAN ID和名字信息);学习相同域名的VTP消息;转发相同域名的VTP消息;可以添加、删除和更改VLAN VLAN信息写入NVRAM。
  • Client模式:请求VTP消息;学习相同域名的VTP消息;转发相同域名的VTP消息;不可以添加、删除和更改VLAN VLAN信息不会写入NVRAM。
  • Transparent模式:不提供VTP消息;不学习VTP消息;转发VTP消息;可以添加、删除和更改VLAN,只在本地有效VLAN信息写入NVRAM。

新交换机出厂时的默认配置是预配置为VLAN1,VTP 模式为服务器。