VTP配置
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
S1

S2

S3

F0/1

F0/1

F0/2

F0/1

1VTP作用:可以在一台交换机上管理整个企业网络的VLAN
2VTP配置命令有:
       1)配置域名
       (config)#  vtp  domain  域名
       2)配置模式
       (config)#  vtp  mode  server / client / transparent

       3)配置密码
       (config)#  vtp  password  密码
       4)配置修剪
       (config)#  vtp  pruning
       5)配置版本
       (config)#  vtp  version  1 / 2

 

3.配置要求
       VTP域名:benet
       VTP密码:benet123
       VTP修剪:启用修剪
       VTP版本:版本1
       VTP服务器与客户机: S1为服务器,S2S3为客户机

 

4.具体配置

 

1S1的配置
S1> en
S1# vlan  data
S1(vlan)# vlan  10  name  CW
S1(vlan)# vlan  20  name  YF
S1(vlan)# vtp  domain  benet
S1(vlan)# vtp  server
S1(vlan)# vtp  password  benet123
S1(vlan)# exit
S1# config  t
S1(config)# int  f0/1
S1(config-if)# switchport  mode  trunk
S1(config-if)# no  shut
以下是把接口划分给VLAN,可以随意指定
S1(config-if)# int  range  f0/3 – 10
S1(config-if-range)# swi       tchport  mode  access
S1(config-if-range)# switchport  access  vlan  10
S1(config-if-range)# no  shut
S1(config-if-range)#exit
S1(config)# int  range  f0/11 – 15
S1(config-if-range)# swi       tchport  mode  access
S1(config-if-range)# switchport  access  vlan  20
S1(config-if-range)# no  shut
S1(config-if-range)#end
S1#

 

 

2S2的配置
S2> en
S2# vlan  database
S2(vlan)# vtp  domain  benet
S2(vlan)# vtp  password  benet123
S2(vlan)# vtp  client
S2(vlan)#exit
S2# config  t
S2(config)# int  range  f0/1 – 2
S2(config-if-range)# switchport  mode  trunk
S2(config-if-range)# no  shut
S2(config-if-range)# end
S2#
接下来要把接口划分给VLAN,可以随意指定

 

 

 

3S3的配置
S3>en
S3# vlan  data
S3(vlan)# vtp  domain  benet
S3(vlan)# vtp  password  benet123
S3(vlan)# vtp  client
S3(vlan)# exit
S3#config  t
S3(config)# int  f0/1
S3(config-if)# switchport  mode  trunk
S3(config-if)# no shut
S3(config-if)# exit
接下来要把接口划分给VLAN,可以随意指定

 

 

 

验证:
(1)       在三台交换机上用#show  vlan-switch来查看vlan,三台交换机都有相同数量的vlan就成功了。
(2)       在三台交换机上用#show  vtp  status来查看vtp信息,能指出vlan的修订次数、当前vlan的数量、vtp域名、vtp模式、是否启用了修剪、是否启用了版本2

 

 

启用VTP修剪

 

接下来做如下配置:
S1#vlan  database
S1(vlan)# vtp  pruning      启用修剪
S1(vlan)#exit
S1#

 

验证:在三台交换机上用#show  vtp  status来查看vtp信息,能指出vlan的修订次数、当前vlan的数量、vtp域名、vtp模式、是否启用了修剪、是否启用了版本2

 

 

 

 

输出信息

 

S1#show vtp status