gaoke 发表于 2012-11-30 08:45:15

cisco vlan 中继协议 vtp

cisco vlan 中继协议 vtp使用条件: 在一个网络上有大量交换机要配置许多相同的vlan的时,可以使用vtp协议vtp域:一个vtp域由一台或多台互连设备组成,它们共同有一个vtp域名,并且一台交换机只能属于一个vtp域vtp模式:   1. 服务器(server)   2.客户端 (client)   3.透明 (transparent)1> 服务器(server):一般情况下一个vtp域只能有一个vtp服务器,它主要用来维护vtp域中的vlan信息列表,它可以创建,删除,修改vlan,也有发送和转发vlan更新信息的功能2> 客户端 (client): 在客户端模式下的交换机不可以创建,删除,修改vlan信息,但是可以转发vlan信息3> 透明 (transparent): 处于透明模式的vtp交换机可以修改,删除,创建vlan信息,但是它的vlan信息的改变并不会向外界发送,它相当于一个独立的交换机,在域中它只有转发的作用。   实例配置      条件:在某个小型网络中使用vtp协议,switch1为vtp服务器,switch2为vtp客户端,switch3为vtp透明模式,并且创建相同的域domain.com,为了保证其安全性,并且不受别处vtp的影响,给这个vtp提供一个密码:domain,.   拓扑图

   配置代码首先要先在连接端口中配置trunk口,实现全网互通   switch1Switch(config)#int range f0/1-2Switch(config-if-range)#switchport mode trunkswitchport trunk allowed vlan allswitch2Switch(config)#int f0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allswitch3Switch(config)#int f0/2Switch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan all因为在一个域中的域名与密码都要相同,所以我们要在三个交换机上都配置相同的vtp域名和密码
Switch(config)#vtp ?domain    Set the name of the VTP administrative domain.mode      Configure VTP device modepasswordSet the password for the VTP administrative domainversion   Set the adminstrative domain to VTP versionSwitch(config)#vtp domain ?WORDThe ascii name for the VTP administrative domain.Switch(config)#vtp domain domain.comChanging VTP domain name from NULL to domain.comSwitch(config)#vtp password domainSetting device VLAN database password to domainSwitch(config)#vtp version 2现在开始在每个交换机上配置不同的模式switch1 (server)   Switch(config)#vtp mode server   Device mode already VTP SERVER.//交换机在默认情况下就是serverswitch2 (client)   Switch(config)#vtp mode client          //配置成client模式   Setting device to VTP CLIENT mode.switch3 (transparent)   Switch(config)#vtp mode transparent   Setting device to VTP TRANSPARENT mode. 测试现在可以在三个交换机中查看一下配置的信息switch1 Switch#show vtp statusVTP Version                     : 2    //版本信息Configuration Revision          : 1      //vlan修改的次数Maximum VLANs supported locally : 255   //支持最大vlan数Number of existing VLANs      : 5   //现在共有的vlan个数 VTP Operating Mode            : Server // 交换机的模式为serverVTP Domain Name               : domain.com//vtp域名VTP Pruning Mode                : Disabled      //未启用修剪功能VTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0x6E 0x82 0xC8 0xB1 0x1C 0xE1 0x2F 0x2E Configuration last modified by 0.0.0.0 at 3-1-93 00:09:25Local updater ID is 0.0.0.0 (no valid interface found)switch2Switch#show vtp statusVTP Version                     : 2Configuration Revision          : 1Maximum VLANs supported locally : 255Number of existing VLANs      : 5VTP Operating Mode            : Client    //vtp模式为clientVTP Domain Name               : domain.comVTP Pruning Mode                : DisabledVTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0x5A 0x53 0xB7 0x05 0xE7 0x28 0x7C 0x56 Configuration last modified by 0.0.0.0 at 3-1-93 00:07:27switch3Switch#show vtp statusVTP Version                     : 2Configuration Revision          : 0Maximum VLANs supported locally : 255Number of existing VLANs      : 5VTP Operating Mode            : Transparent    //vtp模式为transparentVTP Domain Name               : domain.comVTP Pruning Mode                : DisabledVTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0xA9 0x73 0x6F 0x83 0xD5 0x09 0x34 0xA6 Configuration last modified by 0.0.0.0 at 3-1-93 00:13:51现在可以在switch1添加几个vlan,如vlan 10 vlan 20,查看情况Switch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#exit查看 详细情况Switch#show vtp statusVTP Version                     : 2Configuration Revision          : 3Maximum VLANs supported locally : 255Number of existing VLANs      : 7VTP Operating Mode            : ServerVTP Domain Name               : domain.comVTP Pruning Mode                : DisabledVTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0xE3 0x1F 0x98 0x67 0xBB 0x65 0x90 0xA9 Configuration last modified by 0.0.0.0 at 3-1-93 00:20:43Local updater ID is 0.0.0.0 (no valid interface found)在switch2下看一下有什么变化先show 一下vlanSwitch#show vlan 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, Fa0/13                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21                                                Fa0/22, Fa0/23, Fa0/24, Gig1/1                                                Gig1/210   VLAN0010                         active    20   VLAN0020                         active    1002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                  act/unsup VLAN TypeSAID       MTU   Parent RingNo BridgeNo StpBrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet100001   1500-      -      -      -    -      0      010   enet100010   1500-      -      -      -    -      0      020   enet100020   1500-      -      -      -    -      0      01002 fddi101002   1500-      -      -      -    -      0      0   1003 tr    101003   1500-      -      -      -    -      0      0   1004 fdnet 101004   1500-      -      -      ieee -      0      0   1005 trnet 101005   1500-      -      -      ibm-      0      0   Remote SPAN VLANs可以看出已经学到了在vtp服务器上配置的两个 vlan现在可以看一下vtp的详细信息Switch#show vtp statusVTP Version                     : 2Configuration Revision          : 3       //从这里可以看到vlan已经被修改了两次Maximum VLANs supported locally : 255Number of existing VLANs      : 7      //这里变成了7个vlanVTP Operating Mode            : ClientVTP Domain Name               : domain.comVTP Pruning Mode                : DisabledVTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0xE3 0x1F 0x98 0x67 0xBB 0x65 0x90 0xA9 Configuration last modified by 0.0.0.0 at 3-1-93 00:20:43现在查看一下透明模式的变化Switch#show vlan VLAN Name                           Status    Ports---- -------------------------------- --------- -------------------------------1    default                        active    Fa0/1, Fa0/3, Fa0/4, Fa0/5                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21                                                Fa0/22, Fa0/23, Fa0/24, Gig1/1                                                Gig1/21002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                  act/unsup VLAN TypeSAID       MTU   Parent RingNo BridgeNo StpBrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet100001   1500-      -      -      -    -      0      01002 fddi101002   1500-      -      -      -    -      0      0   1003 tr    101003   1500-      -      -      -    -      0      0   1004 fdnet 101004   1500-      -      -      ieee -      0      0   1005 trnet 101005   1500-      -      -      ibm-      0      0   vlan 没有发生变化Switch#show vtp statusVTP Version                     : 2Configuration Revision          : 0Maximum VLANs supported locally : 255Number of existing VLANs      : 5VTP Operating Mode            : TransparentVTP Domain Name               : domain.comVTP Pruning Mode                : DisabledVTP V2 Mode                     : EnabledVTP Traps Generation            : DisabledMD5 digest                      : 0xA9 0x73 0x6F 0x83 0xD5 0x09 0x34 0xA6 Configuration last modified by 0.0.0.0 at 3-1-93 00:13:51也没有增加修改vlan的次数我们也可以尝试一下在switch2上创建vlan 50,看能否成功Switch(config)#vlan 50VTP VLAN configuration not allowed when device is in CLIENT mode.可以看到在客户端模式下是不允许修改vlan的但是可以在透明模式下修改自己的vlan,可以不会向外界进行发送在switch3下Switch(config)#vlan 100查看自身结果Switch#show vlan VLAN Name                           Status    Ports---- -------------------------------- --------- -------------------------------1    default                        active    Fa0/1, Fa0/3, Fa0/4, Fa0/5                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21                                                Fa0/22, Fa0/23, Fa0/24, Gig1/1                                                Gig1/2100VLAN0100                         active    1002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                  act/unsup VLAN TypeSAID       MTU   Parent RingNo BridgeNo StpBrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet100001   1500-      -      -      -    -      0      0100enet100100   1500-      -      -      -    -      0      01002 fddi101002   1500-      -      -      -    -      0      0   1003 tr    101003   1500-      -      -      -    -      0      0   可以看出可以增加vlan,但是我们可以看一下 在另外的交换机上有没有变化1    enet100001   1500-      -      -      -    -      0      010   enet100010   1500-      -      -      -    -      0      020   enet100020   1500-      -      -      -    -      0      01002 fddi101002   1500-      -      -      -    -      0      0   1003 tr    101003   1500-      -      -      -    -      0      0   1004 fdnet 101004   1500-      -      -      ieee -      0      0   1005 trnet 101005   1500-      -      -      ibm-      0      0 vlan100并没有增加vtp剪裁功能的实现   由于默认情况下trunk主链路是允许所以的vlan的数据通过的,这里如果一个一台交换机的所有端口都属于一个vlan的话,那么就没有必要接收另外vlan的数据,这样可以减少网络带宽的开销,这里我们就可以使用vtp剪裁功能来实现。在vtp服务器上开启vtp剪裁功能就可以管理到整个域在witch1上来开启vtp剪裁功能命令很简单,只有一条:Switch(config)#vtp pruningvtp pruning

黄智勇 发表于 2013-3-18 12:05:02

精典之极就是精斑!!!

774530750 发表于 2013-5-16 23:51:44

生,容易。活,容易。生活,不容易。

lig 发表于 2013-5-19 08:50:19

读书读到抽筋处,文思方能如尿崩!

小雪崩 发表于 2013-5-22 11:30:27

学习了,谢谢分享、、、

hudeya 发表于 2013-5-26 08:39:27

看帖回帖是美德!:lol

???紵 发表于 2013-5-31 03:07:18

写的真的很不错
页: [1]
查看完整版本: cisco vlan 中继协议 vtp