且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NA-NP-IE系列实验46:VTP 配置

更新时间:2022-09-25 23:29:00

实验46:VTP 配置
1. 实验目的
通过本实验,读者可以掌握如下技能:
1) 理解VTP 的三种模式
2) 熟悉VTP 的配置
2. 实验拓扑
拓扑图
NA-NP-IE系列实验46:VTP 配置
3. 实验步骤
 
注:
1.VTP 修剪和VTP 版本只需要在一个VTP server 进行即可,其他server 或者client
会自动跟着更改。VTP 修剪是为了防止不必要的流量从trunk 链路上通过,通常需要启用。
2.有的IOS 版本可以在全局模式下配置vlan,我用的这个只支持在vlan database 下配置vlan
3. 把三台交换机的配置清除干净,重启交换机
delete flash:vlan.dat
erase startup-config
reload
sw1:server
sw2:client
sw3;transparent
 
 
sw1(vlan)#vtp ser//以上配置S1 VTP server,实际上这是默认值
 
Device mode already VTP SERVER.
sw1(vlan)#vtp domain cisco//以上配置VTP 域名
 
Changing VTP domain name from NULL to cisco
sw1(vlan)#vtp password cisco//以上配置VTP 的密码,目的是为了安全,防止不明身份的交换机加入到域中
Setting device VLAN database password to cisco.
sw1(vlan)#vlan 2 name ke
VLAN 2 added:
    Name: ke
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#vlan da
sw1(vlan)#vlan 3 name haojian
VLAN 3 added:
    Name: haojian
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#sh vlan
sw1#sh vtp status
VTP Version                     : 2//VTP 支持版本2
 
Configuration Revision          : 2/修订号为2,该数值非常重要
Maximum VLANs supported locally : 256
Number of existing VLANs        : 7//VLAN 数量
 
VTP Operating Mode              : Server//VTP 模式
 
VTP Domain Name                 : cisco   VTP 域名
VTP Pruning Mode                : Disabled//VTP 修剪没有启用
 
VTP V2 Mode                     : Disabled//VTP 版本没有启用,现在是版本1
 
VTP Traps Generation            : Disabled
MD5 digest                      : 0x35 0x3A 0x41 0x40 0x4F 0x41 0xC4 0xAE
Configuration last modified by 0.0.0.0 at 3-1-02 00:09:45
Local updater ID is 0.0.0.0 (no valid interface found)
sw1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
 
sw1(config)#exit
sw1#
*Mar  1 00:11:54.643: %SYS-5-CONFIG_I: Configured from console by console
sw1#vlan da
sw1(vlan)#vtp pruning
Pruning switched ON//VTP 修剪启用
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
w2#vlan da
 
 
 
sw2(vlan)#vtp client
Setting device to VTP CLIENT mode.
sw2(vlan)#vtp domain cisco
Changing VTP domain name from NULL to cisco
sw2(vlan)#vtp pass cisco
Setting device VLAN database password to cisco.
sw2(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
sw2#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
2 VLAN0002 active ke
3 VLAN0003 active haojian
1002 fddi-default act/unsup
//可以看到SW2 已经学习到了在SW1 上创建的VLAN 了。
 
sw2#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Client
VTP Domain Name                 : cisco
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xDC 0x3B 0x6E 0x23 0xBA 0x87 0x07 0x99
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
sw2#
 
Sw3#vlan
*Mar  1 00:06:12.307: %SYS-5-CONFIG_I: Configured from console by consoleda
sw3(vlan)#vtp transparent
Setting device to VTP TRANSPARENT mode.
sw3(vlan)#vtp domain cisco
Changing VTP domain name from NULL to cisco
sw3(vlan)#vtp password cisco
Setting device VLAN database password to cisco.
sw3(vlan)#exit
APPLY completed.
Exiting....
sw3#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Transparent
VTP Domain Name                 : cisco
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xDC 0x3B 0x6E 0x23 0xBA 0x87 0x07 0x99
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
S3#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
 


本文转自gauyanm 51CTO博客,原文链接:http://blog.51cto.com/gauyanm/242940,如需转载请自行联系原作者