码迷,mamicode.com
首页 > 其他好文 > 详细

【VTP】CISCO VTP协议笔记

时间:2014-10-07 19:53:33      阅读:406      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   io   ar   for   strong   


bubuko.com,布布扣

 
?
  • 简化大型园区网中VLAN信息库同步的问题(同一个VTP管理域中)
  • 只同步VLAN信息
  • 需要交换机之间的trunk链路支持
 
1.VTP mode
 

bubuko.com,布布扣


Transparent模式的VTP 配置修订号始终为0
 
2.VTP的运作
  • VTP协议通过组播地址0100-0CCC-CCCC在Trunk链路上发送VTP通告;
  • VTP Server和clients通过最高的修订号来同步数据库;
  • VTP协议每隔5分钟发送一次VTP通告或者有变化时发生;
 
3.VTP的配置
Switch(config)# vtp domain cisco
配置VTP域名
 
Switch(config)# vtp mode {server | client | transparent}
配置本机VTP模式
 
Switch(config)# vtp password x
(可选)配置密码
 
Switch# show vtp password 
 
4.VTP的几个问题
 
bubuko.com,布布扣

 
如果VTP client的配置修订号比Server的高,那么client也是能够将server的vlan信息覆盖掉的。
 
bubuko.com,布布扣


 
上图中,server及client的配置修订号相同,但是vlan信息则不同,这时候就会报错,提示md5 digest checksum mismatch
 
5.VTP pruning
 
1)测试目的:VLAN信息传递
 
bubuko.com,布布扣

 
SW1及SW2配置为VTP mode client;SW3配置为VTP mode Server
在SW3上创建10、20、30三个VLAN
SW1及SW2都能学习到,三岁小孩都能做,就不多说了
SW3#sh vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 1
VTP Domain Name                 : ccnp
VTP Pruning Mode                : Disabled !! 默认VTP prunnig是关闭的
VTP Traps Generation            : Disabled
Device ID                       : 000a.8a07.8280
Configuration last modified by 0.0.0.0 at 3-5-93 00:11:48
Local updater ID is 0.0.0.0 (no valid interface found)
 
Feature VLAN:
--------------
VTP Operating Mode                : Server
Maximum VLANs supported locally   : 1005
Number of existing VLANs          : 8
Configuration Revision            : 15
MD5 digest                        : 0x49 0x3C 0x1F 0x79 0x15 0x00 0xC7 0xAE 
                                    0x0E 0xDC 0xDD 0xEF 0x93 0xA5 0xB6 0x26
 
2)测试目的:trunk allowed vlan
 
bubuko.com,布布扣
 
 
继续吧,将SW1及SW2的连接PC的接口划入vlan10
完成后两个PC就能够互相通信了。
这时候我们在SW1上看一下trunk的状态:
SW1#sh int trunk 
Port        Mode             Encapsulation  Status        Native vlan
Fa0/20      on               802.1q         trunking      1
 
Port        Vlans allowed on trunk
Fa0/20      1-4094
 
Port        Vlans allowed and active in management domain
Fa0/20      1,10,20,30
 
Port        Vlans in spanning tree forwarding state and not pruned
Fa0/20      1,10,20,30             !!在关闭VTP prunnig的情况下,trunk默认放行所有VLAN的流量,这在SW2及SW3上情况一样
 
接下去我们在SW1的Fa0/20接口上,做switchport trunk allowed vlan remove 10,将vlan10的流量修剪掉,这时候PC之间就无法ping通了,再去R1上看一下:
SW1#sh int trunk 
Port        Mode             Encapsulation  Status        Native vlan
Fa0/20      on               802.1q         trunking      1
 
Port        Vlans allowed on trunk
Fa0/20      1-9,11-4094
 
Port        Vlans allowed and active in management domain
Fa0/20      1,20,30
 
Port        Vlans in spanning tree forwarding state and not pruned
Fa0/20      1,20,30
 
注意,此时此刻虽然SW1在fa0/20口上将vlan10的流量修剪了,但是SW3的fa0/20口确实依然放行该流量的,不过不管怎样,PC之间是无法互访了,这里只是做个演示,知道一下allowed vlan的作用。
当然,这是手工修剪的方式。
 
3)测试目的:VTP pruning
 
bubuko.com,布布扣
 
 
去掉步骤2中配置在SW1上的命令,还原实验环境。
接下去我们在SW3,也就是VTP的server上开启vtp pruning。
SW3#sh vtp st
VTP Version capable             : 1 to 3
VTP version running             : 1
VTP Domain Name                 : ccnp
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : 000a.8a07.8280
Configuration last modified by 0.0.0.0 at 3-5-93 02:01:49
Local updater ID is 0.0.0.0 (no valid interface found)
 
Feature VLAN:
--------------
VTP Operating Mode                : Server
Maximum VLANs supported locally   : 1005
Number of existing VLANs          : 8
Configuration Revision            : 17
MD5 digest                        : 0x73 0x52 0x60 0xE7 0x4D 0xA5 0xC7 0x4F 
                                    0xCA 0x3D 0x6F 0x1D 0x3F 0x23 0x03 0xBB 
 
在VTP server mode的SW3上开启VTP pruning后,Client 的SW1及SW2都会学习到并且也开启自己的VTP pruning。
如此一来,三台交换机都会进行VTP报文的交互,告知自己本地存在接入用户的VLAN。对于没有用户的VLAN,将会被自动修剪掉,我们看一下:
SW1#show int trunk 
Port        Mode             Encapsulation  Status        Native vlan
Fa0/20      on               802.1q         trunking      1
 
Port        Vlans allowed on trunk
Fa0/20      1-4094
 
Port        Vlans allowed and active in management domain
Fa0/20      1,10,20,30
 
Port        Vlans in spanning tree forwarding state and not pruned
Fa0/20      1,10        !! 在R1上,Fa0/20口修剪得只剩下了vlan 1和10
SW2、SW3也是类似的情况;注意,此刻我们是没有在trunk口上做任何静态配置的allowed vlan配置
 
接下去,我们在SW2上,将vlan10的端口移除,可直接在fa0/2上no switchport access vlan
如此一来SW2上就没有vlan10的用户了,sw2会泛洪这一消息以便其他交换机知道。
SW3收到这一消息后,知道SW2不再有vlan10 的用户,也就不再需要vlan10的流量了,于是在自己的FA0/22口上将vlan10修剪掉:
SW3#sh int tru 
Port        Mode             Encapsulation  Status        Native vlan
Fa0/20      on               802.1q         trunking      1
Fa0/22      desirable        n-isl          trunking      1
 
Port        Vlans allowed on trunk
Fa0/20      1-4094
Fa0/22      1-4094
 
Port        Vlans allowed and active in management domain
Fa0/20      1,10,20,30
Fa0/22      1,10,20,30
 
Port        Vlans in spanning tree forwarding state and not pruned
Fa0/20      1,10
Fa0/22      1           !! vlan10被修剪
 
最后注意:
• Vtp pruning只能在server mode上开启
• Server mode上开启后,client都会自动开启pruning
• Vtp pruning默认是关闭的
 
 
 
[转自:http://blog.sina.com.cn/s/blog_5ec353710101d9g7.html]
 

【VTP】CISCO VTP协议笔记

标签:des   style   blog   http   color   io   ar   for   strong   

原文地址:http://www.cnblogs.com/597845634ds/p/4009531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!