一、试验拓扑:
VTP互通的6个条件:1、相同域名2、trunk链路3、vtp模式4、配置修订号5、版本一致6、密码相同
作用:
VTP是用来管理vlan信息的 ,分为客户机 服务器和透明模式 ,就是在一台设备上来配置vlan,然后其余的机器都来同步vlan信息,简单的说 就是为了节省配置时间 server是VTP服务器模式。
client是VTP客户模式,可以学习server的vlan,不可增删vlan 。
transparet是透明模式,不可学习server的vlan,可增删vlan。
server需要设domain XX,client设的domian需要和server一样也是XX,最好加上password。
二、试验目的:
1、成功配置VTP的各个参数,并检验配置生效。
2、创建VTP域,配置各个运行模式,配置VTP口令。
3、配置VTP修剪,配置VTP版本,在VTP中增加和删除交换机
4、把bbb交换机换成透明模式,出现怎样的结果。
三、试验步骤:
1、配置交换机aaa,模式为服务器模式
Router(config)#no ip domain lookup (关闭域名解析、防止超时)
Router(config)#line console 0
Router(config-line)#exec-timeout 0 0
Router(config-line)#logging synchronous
Router(config-line)#exit
Router(config)#hostname aaa 修改名称
aaa#vlan database (此模式是在模拟器中配置,真实机需在全局模式中配置)
aaa(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
aaa(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
aaa(vlan)#vlan 30
VLAN 30 added:
Name: VLAN0030
aaa(vlan)#exit
APPLY completed.
Exiting....
aaa#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
aaa#vlan data
*Mar 1 00:08:02.655: %SYS-5-CONFIG_I: Configured from console by console
aaa#vlan database
aaa(vlan)#vtp domain t17
Changing VTP domain name from NULL to t17
aaa(vlan)#vtp server
Device mode already VTP SERVER.
aaa(vlan)#vtp password 123
Setting device VLAN database password to 123.
aaa(vlan)#exit
APPLY completed.
Exiting....
aaa#conf t
Enter configuration commands, one per line. End with CNTL/Z.
aaa(config)#interface f0/0
aaa(config-if)#swit
aaa(config-if)#switchport mode trunk 配置trunk
*Mar 1 00:10:03.103: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunk
aaa(config-if)#exit
aaa(config)#exit
查看vtp状态
2、配置交换机bbb为客户端,并且修剪配置
bbb#vlan database
bbb(vlan)#vtp domain t17
Changing VTP domain name from NULL to t17
bbb(vlan)#vtp mode client
bbb(vlan)#vtp client
Setting device to VTP CLIENT mode..
bbb(vlan)#vtp password 123
Setting device VLAN database password to 123.
bbb(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
bbb(config)#interfae f0/0
bbb(config)#interface f0/0
bbb(config-if)#switchport mode trunk
*Mar 1 00:12:36.055: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trun
Router(config-if)#interface
Router(config-if)#interface f0/1
Router(config-if)#switchport mode trunk
Router(config-if)#exit
*Mar 1 00:12:52.819: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trun
bbb(config)#exit
bbb#vlan database
bbb(vlan)#vtp pruning 修剪
Pruning switched ON
bbb(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
bbb#show vtp status
VTP Version : 2
Configuration Revision
: 1
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode :
Client
VTP Domain Name
: t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xE6 0xF6 0xDD 0x00 0x9D 0x20 0xB5 0x5E
Configuration last modified by 0.0.0.0 at 3-1-02 00:06:54
bbb#show vlan-switch brief
VLAN Name Status Ports
---- -------------------------------- --------- --------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa
Fa0/14, Fa0/15
10 VLAN0010 active
20 VLAN0020 active
30 VLAN0030 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
3、配置交换机ccc 为客户端模式
Router#vlan database
Router(vlan)#vtp clien
Router(vlan)#vtp client
Setting device to VTP CLIENT mode.
Router(vlan)#vtp domain t17
Changing VTP domain name from NULL to t17
Router(vlan)#vtp password 123
Setting device VLAN database password to 123.
Router(vlan)#vtp version 2
Router(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface f0/1
Router(config-if)#switchport mode trunk
*Mar 1 00:15:33.435: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trun
Router(config-if)#exit
Router(config)#exit
*Mar 1 00:15:42.527: %SYS-5-CONFIG_I: Configured from console by console
ccc#show vtp status
VTP Version : 2
Configuration Revision : 1
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode
: Client
VTP Domain Name :
t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xE6 0xF6 0xDD 0x00 0x9D 0x20 0xB5 0x5E
4、在aaa的交换机vtp中,增加vlan40
aaa#vlan data
aaa(vlan)#vlan 40
VLAN 40 added:
Name: VLAN0040
aaa(vlan)#exit
APPLY completed.
Exiting....
aaa#show vtp status
VTP Version : 2
Configuration Revision :
2
Maximum VLANs supported locally : 256
Number of existing VLANs : 9
VTP Operating Mode : Server
VTP Domain Name : t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x86 0xF1 0x65 0x37 0xB7 0x17 0x81 0xBA
查看bbb、ccc交换机
5、删除vtp 服务器模式中的vlan30
aaa#vlan database
aaa(vlan)#no vlan 30
Deleting VLAN 30...
aaa(vlan)#exit
查看bbb、ccc交换机
6、把交换机bbb改成透明模式 vtp再次通告信息
bbb#vlan data
bbb#vlan database
bbb(vlan)#vtp tran
bbb(vlan)#vtp transparent
Setting device to VTP TRANSPARENT mode.
bbb(vlan)#
bbb(vlan)#
bbb(vlan)#exit
APPLY completed.
Exiting....
bbb#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 9
VTP Operating Mode : Transparent
VTP Domain Name : t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x86 0xF1 0x65 0x37 0xB7 0x17 0x81 0xBA
7、在vtp中添加vlan30
aaa#vlan database
aaa(vlan)#vlan 50
VLAN 50 added:
Name: VLAN0050
aaa(vlan)#exit
APPLY completed.
Exiting....
aaa#show vtp status
VTP Version : 2
Configuration Revision : 4
Maximum VLANs supported locally : 256
Number of existing VLANs : 9
VTP Operating Mode : Server
VTP Domain Name : t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x74 0x45 0x8A 0xFD 0x3F 0x17 0x83 0x36
查看bbb 、ccc交换机
ccc#show vtp status
VTP Version : 2
Configuration Revision : 4
Maximum VLANs supported locally : 256
Number of existing VLANs : 9
VTP Operating Mode : Client
VTP Domain Name : t17
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x74 0x45 0x8A 0xFD 0x3F 0x17 0x83 0x36
四、实验结果:
在配置vtp成功后,客户机bbb、ccc生效,当客户机模式的交换机bbb改为透明模式后,再次对vtp添加或删除vlan时,vtp只对交换机ccc生效 ,交换机bbb的修订号变为0
下一节为pvst生成树的配置
本文出自 “稻草人” 博客,谢绝转载!