不朽金身:VTP实验报告
来源:百度文库 编辑:中财网 时间:2024/05/07 05:13:59
.1 实验任务 在Catalyst 2950交换机上配置VTP 1.2 实验环境和网络拓扑 1.3 完成标准 (1) 按照拓扑图要求连接交换机,在VTP服务器上配置VLAN,配置为VTP客户机的交换机能够学习到VLAN信息,不能添加、删除和修改VLAN。(2) 配置为透明模式的交换机可以自己添加、删除和修改VLAN,但是不学习VLAN信息。 2.详细操作步骤 Step 1: 配置交换机的VTP (1) 配置交换机的A、B和C的VTP域为Benet 交换机A配置如下:Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname A //配置交换机名为A *Mar 1 00:00:44.671: %SYS-5-CONFIG_I: Configured from console by consoleA(config)#interface f0/0 //配置端口0为中继端口连接交换机B A(config-if)#switchport mode trunk*Mar 1 00:21:45.123: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunkA(config-if)#exitA(config)#exitA#vlan databaseA(vlan)#vtp domain benet //配置VTP域为benetChanging VTP domain name from NULL to benet 交换机B配置如下:Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname B*Mar 1 00:00:44.671: %SYS-5-CONFIG_I: Configured from console by consoleB(config)#interface f0/0 //配置端口0为中继端口连接交换机A B(config-if)#switchport mode trunk*Mar 1 00:18:28.991: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunkB(config)#interface f0/1 //配置端口1为中继端口连接交换机C B(config-if)#switchport mode trunk*Mar 1 00:18:38.791: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trunkB(config-if)#exitA(config)#exitB#vlan databaseB(vlan)#vtp domain benet //配置VTP域为benetChanging VTP domain name from NULL to benet 交换机C配置如下:Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname C*Mar 1 00:01:12.647: %SYS-5-CONFIG_I: Configured from console by cosoleC(config)#interface f0/0 //配置端口0为中继端口连接交换机C(config-if)#switchport mode trunk*Mar 1 00:16:39.635: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunkC(config-if)#exitA(config)#exitC#vlanC#vlan databaseC(vlan)#vtp domain benet //配置VTP域为benetChanging VTP domain name from NULL to benet (2) 配置交换机A、B和C的VTP工作模式分别为Server、Transparent和Client 交换机A配置如下:A(vlan)#vtp server //配置交换机A的VTP工作模式为Server Device mode already VTP SERVER.A(vlan)#exitAPPLY completed.Exiting....A#show vtp statusVTP Version : 2Configuration Revision : 0 //配置修改编号从0开始 Maximum VLANs supported locally : 256Number of existing VLANs : 5VTP Operating Mode : ServerVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21Configuration last modified by 0.0.0 .0 at 0-0-00 00:00:00Local updater ID is 0.0.0 .0 (no valid interface found) 交换机B配置如下:B(vlan)#vtp transparent //配置交换机B的VTP工作模式为TransparentSetting device to VTP TRANSPARENT mode.B(vlan)#exitAPPLY completed.Exiting....B#show vtp statusVTP Version : 2Configuration Revision : 0 //配置修改编号从0开始Maximum VLANs supported locally : 256Number of existing VLANs : 5VTP Operating Mode : TransparentVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21Configuration last modified by 0.0.0 .0 at 0-0-00 00:00:00 交换机C配置如下:C(vlan)#vtp client //配置交换机C的VTP工作模式为ClientSetting device to VTP CLIENT mode.C(vlan)#exitIn CLIENT state, no apply attempted.Exiting....C#show vtp statusVTP Version : 2Configuration Revision : 0 //配置修改编号从0开始Maximum VLANs supported locally : 256Number of existing VLANs : 5VTP Operating Mode : ClientVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21Configuration last modified by 0.0.0 .0 at 0-0-00 00:00:00 Step 2: 配置交换机的VLAN,并验证VTP各模式的特点 (1) 在交换机A上配置VLAN2和VLAN3 交换机A配置如下:A#vlan databaseA(vlan)#vlan 2 name VLAN2 //配置VLAN2和VLAN3 VLAN 2 added: Name: VLAN2A(vlan)#vlan 3 name VLAN3VLAN 3 added: Name: VLAN3A(vlan)#exitAPPLY completed.Exiting....A#show vlan-switch VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/0, Fa0/1, 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/152 VLAN2 active 3 VLAN3 active 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10032 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 交换机B配置如下:B#show vlan-switch VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/0, Fa0/1, 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 Fa1/0, Fa1/1, Fa1/2, Fa1/3 Fa1/4, Fa1/5, Fa1/6, Fa1/7 Fa1/8, Fa1/9, Fa1/10, Fa1/11 Fa1/12, Fa1/13, Fa1/14, Fa1/15//因为交换机B的VTP模式为Transparent,在此不同步Server上的VLAN配置 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10031002 fddi 101002 1500 - - - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 交换机C配置如下:C#show vlan-switch VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, 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/152 VLAN2 active 3 VLAN3 active //因为交换机C的VTP模式为Client,在此同步Server上的VLAN配置 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10032 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - 0 - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 (2) 在交换机B上配置VLAN4和VLAN5 B#vlan databaseB(vlan)#vlan 4 name VLAN4 //配置VLAN4和VLAN5 VLAN 4 added: Name: VLAN4B(vlan)#vlan 5 name VLAN5VLAN 5 added: Name: VLAN5B(vlan)#exitAPPLY completed.Exiting....B#show vlan-s 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, Fa1/0, Fa1/1 Fa1/2, Fa1/3, Fa1/4, Fa1/5 Fa1/6, Fa1/7, Fa1/8, Fa1/9 Fa1/10, Fa1/11, Fa1/12, Fa1/13 Fa1/14, Fa1/154 VLAN4 active 5 VLAN5 active 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10034 enet 100004 1500 - - - - - 0 05 enet 100005 1500 - - - - - 0 0 VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1002 fddi 101002 1500 - - - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 交换机A配置如下:A#show vlan-sVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, 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/152 VLAN2 active3 VLAN3 active//因为交换机B的VTP模式为Transparent,在此不同步Server上的VLAN配置 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10032 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 交换机C配置如下:C#show vlan-switch VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, 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/152 VLAN2 active3 VLAN3 active//因为交换机B的VTP模式为Transparent,在此不同步Server上的VLAN配置 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10032 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - 0 - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 Step 3: 配置交换机的VTP口令 (1) 配置交换机A的VTP口令,添加VLAN6 交换机A配置如下:A#vlan dA(vlan)#vtp password cisco //配置VTP口令为cisco Setting device VLAN database password to cisco.A(vlan)#vlan 6 name VLAN6 //添加VLAN6 VLAN 6 added: Name: VLAN6A(vlan)#exitAPPLY completed.Exiting....A#A#show vtp sVTP Version : 2Configuration Revision : 2 //以上操作导致配置修改编号增加 Maximum VLANs supported locally : 256Number of existing VLANs : 8VTP Operating Mode : ServerVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledA con0 is now available : 0x54 0xA2 0xFA 0x30 0x7D 0x9D 0x3C 0xC7Configuration last modified by 0.0.0 .0 at 3-1-02 00:09:07Local updater ID is 0.0.0 .0 (no valid interface found) 交换机B配置如下:B#show vtp sVTP Version : 2Configuration Revision : 0 //交换机B为Transparent工作模式,不同步VTP中VLAN信息,配置修改编号无变化 Maximum VLANs supported locally : 256Number of existing VLANs : 7VTP Operating Mode : TransparentVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xA2 0xD1 0x76 0x41 0x79 0xF4 0x7F 0x4DConfiguration last modified by 0.0.0 .0 at 3-1-02 00:07:14 交换机C配置如下:C#show vtp sVTP Version : 2Configuration Revision : 1 //同步Server的VLAN2、VLAN3,配置修改该编号增加,但没有设置VTP口令,针对Server后两次动作没有同步,配置修改编号没有增加 Maximum VLANs supported locally : 256Number of existing VLANs : 7VTP Operating Mode : ClientVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xC0 0xD6 0xEA 0xAC 0x21 0x06 0x71 0x4BConfiguration last modified by 0.0.0 .0 at 3-1-02 00:03:55 (2) 配置交换机B和C的VTP命令 交换机A配置如下:B#vlan dB(vlan)#vtp password cisco //配置VTP口令为ciscoSetting device VLAN database password to cisco.B(vlan)#exitAPPLY completed.Exiting....B#show vtp sVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 256Number of existing VLANs : 7VTP Operating Mode : TransparentVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xE7 0x04 0xDD 0xBA 0x5D 0x21 0x32 0x19Configuration last modified by 0.0.0 .0 at 3-1-02 00:12:24 交换机C配置如下:C#vlan dC(vlan)#vtp password cisco //配置VTP口令为ciscoSetting device VLAN database password to cisco.C(vlan)#exitIn CLIENT state, no apply attempted.Exiting....C#show vtp sVTP Version : 2Configuration Revision : 2 //修改口令后同步Server的VLAN信息导致配置修改编号增加 Maximum VLANs supported locally : 256Number of existing VLANs : 8VTP Operating Mode : ClientVTP Domain Name : benetVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x54 0xA2 0xFA 0x30 0x7D 0x9D 0x3C 0xC7Configuration last modified by 0.0.0 .0 at 3-1-02 00:09:07C#show vlan-s VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, 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/152 VLAN2 active3 VLAN3 active6 VLAN6 active //与Server同步VLAN6 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 10032 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 06 enet 100006 1500 - - - - - 0 01002 fddi 101002 1500 - 0 - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 1002 VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1004 fdnet 101004 1500 - - 1 ibm - 0 01005 trnet 101005 1500 - - 1 ibm - 0 0 Step 4: 配置VTP修剪 在交换机A、B和C上配置VTP修剪 交换机A配置如下:A#vlan dA(vlan)#vtp pruning //配置VTP修剪 Pruning switched ONA(vlan)#exitAPPLY completed.Exiting....A#show vtp sVTP Version : 2Configuration Revision : 3 //以上操作导致配置修改标号增加 Maximum VLANs supported locally : 256Number of existing VLANs : 8VTP Operating Mode : ServerVTP Domain Name : benetVTP Pruning Mode : Enabled //VTP剪切状态开启 VTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x5B 0xA1 0xB8 0x83 0x26 0xF0 0x94 0xB8Configuration last modified by 0.0.0 .0 at 3-1-02 00:12:48Local updater ID is 0.0.0 .0 (no valid interface found) 交换机B配置如下:B#vlan dB(vlan)#vtp pruning //配置VTP修剪Pruning switched ONB(vlan)#exitAPPLY completed.Exiting....B#show vtp sVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 256Number of existing VLANs : 7VTP Operating Mode : TransparentVTP Domain Name : benetVTP Pruning Mode : Enabled //VTP剪切状态开启VTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xE7 0x04 0xDD 0xBA 0x5D 0x21 0x32 0x19Configuration last modified by 0.0.0 .0 at 3-1-02 00:12:24 交换机C配置如下:C(vlan)#vtp pruning //配置VTP修剪Pruning already switched on.C(vlan)#exitIn CLIENT state, no apply attempted.Exiting....C#show vtp sVTP Version : 2Configuration Revision : 3 //同步Server导致配置修改编号增加 Maximum VLANs supported locally : 256Number of existing VLANs : 8VTP Operating Mode : ClientVTP Domain Name : benetVTP Pruning Mode : Enabled //VTP剪切状态开启VTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x5B 0xA1 0xB8 0x83 0x26 0xF0 0x94 0xB8Configuration last modified by 0.0.0 .0 at 3-1-02 00:12:48 3.实验总结 通过使用VTP协议,交换机之间能够互相传递VLAN信息,实现了VLAN的统一配置和统一管理。此实验简单描述了VTP的配置过程,配置要点为: l 交换机的VTP工作模式:Server、Client和Transparent。Server模式下交换机可控制它所在域中Vlan的生成和修改;Client模式下交换机不允许管理员创建、修改或删除;Transparent模式下交换机不参与VTP,只转发VTP通告消息,但它可以创建和删除本地Vlan。l 每个VTP设备会纪录自己的VTP配置修改编号;VTP通告会包含发送者的VTP配置修改编号,这一信息用于确认接受到的信息是否比当前的信息更新。每个VTP通告从配置版本号0开始。每当发生变化时,配置版本编号加1。l 在交换机上配置VTP口令,用于保证网络内交换机VLAN配置的安全性。同一VTP域内的交换机,口令配置要一致。l VTP通过修剪来减少没有必要扩散的通信量,提高中继链路的带宽利用率。