实验目的
- 了解VTP的运行原理
- 掌握VTP的配置方法
实验拓扑
实验需求
- 根据实验拓扑图,完成设备的基本配置;
- 把交换机互连的链路配置成Trunk,采用Dot1q封装;
- SW1是VTP服务器,SW2和SW3是VTP客户端,VTP域名为xmws,VTP密码为wisdom,开启VTP裁剪;
- 在SW1上创建VLAN10和VLAN20,名字为IT和HR;
- 分别在SW1、SW2和SW3上把相应的接口划入VLAN10和VLAN20;
实验步骤
步骤1:设备的基本配置
配置PC1:
VPCS> set pcname PC1 //设置主机名
PC1> ip 10.1.1.1/24 //设置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 10.1.2.1/24
配置PC3:
VPCS> set pcname PC3
PC3> ip 10.1.1.2/24
配置PC4:
VPCS> set pcname PC4
PC4> ip 10.1.2.2/24
配置PC5:
VPCS> set pcname PC5
PC5> ip 10.1.1.3/24
配置PC6:
VPCS> set pcname PC6
PC6> ip 10.1.2.3/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
配置SW3:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW3
SW3(config)#no ip domain-lookup
SW3(config)#line console 0
SW3(config-line)#exec-timeout 0 0
SW3(config-line)#logging synchronous
SW3(config-line)#end
SW3#
步骤2:配置Trunk
配置SW1:
SW1(config)#interface Eth0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#interface range Eth0/0 , Eth0/3
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#end
SW2#
配置SW3:
SW3(config)#interface Eth0/0
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#end
SW3#
步骤3:配置VTP
配置SW1:
SW1(config)#vtp mode server
SW1(config)#vtp domain xmws
SW1(config)#vtp password wisdom
SW1(config)#vtp pruning
配置SW2:
SW2(config)#vtp mode client
SW2(config)#vtp domain xmws
SW2(config)#vtp password wisdom
配置SW3:
SW3(config)#vtp mode client
SW3(config)#vtp domain xmws
SW3(config)#vtp password wisdom
步骤4:配置VLAN
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Eth0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface Eth0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 20
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#interface Eth0/1
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
SW2(config)#interface Eth0/2
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 20
SW2(config-if)#end
SW2#
配置SW3:
SW3(config)#interface Eth0/1
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 10
SW3(config-if)#exit
SW3(config)#interface Eth0/2
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 20
SW3(config-if)#end
SW3#
实验检查
步骤1:检查VTP
检查SW1:
SW1#show vtp status
VTP Version capable : 1 to 3
VTP version running : 1
VTP Domain Name : xmws
VTP Pruning Mode : Enabled
VTP Traps Generation : Disabled
Device ID : aabb.cc80.7000
Configuration last modified by 0.0.0.0 at 4-23-20 17:18:33
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 : 7
Configuration Revision : 3
MD5 digest : 0x85 0x2D 0x06 0xA3 0x42 0x1B 0x93 0xEE
0x90 0x66 0x1F 0x3C 0xA9 0x52 0xD5 0x38
SW1是VTP服务器,域名是xmws,裁剪已经启用。
SW1#show vtp password
VTP Password: wisdom
VTP密码是wisdom。
检查SW2:
SW2#show vtp status
VTP Version capable : 1 to 3
VTP version running : 1
VTP Domain Name : xmws
VTP Pruning Mode : Enabled
VTP Traps Generation : Disabled
Device ID : aabb.cc80.8000
Configuration last modified by 0.0.0.0 at 4-23-20 17:18:33
Feature VLAN:
VTP Operating Mode : Client
Maximum VLANs supported locally : 1005
Number of existing VLANs : 7
Configuration Revision : 3
MD5 digest : 0x85 0x2D 0x06 0xA3 0x42 0x1B 0x93 0xEE
0x90 0x66 0x1F 0x3C 0xA9 0x52 0xD5 0x38
SW2是VTP客户端,域名是xmws,裁剪已经启用。
SW2#show vtp password
VTP Password: wisdom
VTP密码是wisdom。
步骤2:检查VLAN信息
检查SW1:
SW1#show vlan brief
VLAN Name Status Ports
1 default active Et0/3
10 IT active Et0/1
20 HR active Et0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
SW1作为VTP服务器,已经创建好VLAN10和VLAN20。
检查SW2:
SW2#show vlan brief
VLAN Name Status Ports
1 default active
10 IT active Et0/1
20 HR active Et0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
SW2作为VTP客户端,已经同步VTP服务器的VLAN信息。
检查SW3:
SW3#show vlan brief
VLAN Name Status Ports
1 default active Et0/3
10 IT active Et0/1
20 HR active Et0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
SW3作为VTP客户端,已经同步VTP服务器的VLAN信息。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。