交换机配置——VTP管理交换机的VLAN配置
一、实验目的:将S1配置成VTP-Server,S2配置成VTP-Transparent,S3配置成VTP-Client,S4配置成VTP-Client
二、拓扑图如下

三、具体步骤:
(1)S1交换机的配置
Switch>enable  --进入特权模式
Switch#config terminal  --进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S1  --修改交换机名为S1
S1(config)#vtp domain test  --创建test域
Changing VTP domain name from NULL to test
S1(config)#vtp mode server  --设置S1为Server 
Device mode already VTP SERVER.
S1(config)#vlan 7  --创建并进入vlan 7端口,并开启
S1(config-vlan)#vlan 8  --创建并进入vlan 8 端口,并开启
S1(config-vlan)#interface f0/1  --进入f0/1端口
S1(config-if)#switchport mode trunk  --将端口改为trunk模式
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
(2)S2交换机的配置
Switch#enable  --进入特权模式
Switch#config terminal  --进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S2  --修改交换机名为S2
S2(config)#vtp mode transparent  --将S2设置为Transparent
Device mode already VTP TRANSPARENT.
S2(config)#interface range f0/1-2  --进入f0/1和f0/2端口
S2(config-if)#switchport mode  trunk  --将端口改为trunk模式
(3)S3交换机配置
Switch#enable  --进入特权模式
Switch#config terminal  --进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S3  --修改交换机名为S3
S3(config)#vtp mode client  --将S3设置为Client
Device mode already VTP CLIENT.
S3(config)#interface range f0/1-2   --进入f0/1和f0/2端口
S3(config-if)#switchport mode trunk --将端口改为trunk模式
(4)S4交换机配置
Switch#enable  --进入特权模式
Switch#config terminal  --进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S4  --将交换机名修改为S4
S4(config)#vtp mode client  --将S4设置为Client
Device mode already VTP CLIENT.
S4(config)#interface f0/1  --进入f0/1端口
S4(config-if)#switchport mode  trunk  --将端口改为trunk模式
四、验证,分别在各台交换机上查看VLAN
(1)S1

(2)S2
 
解释:S2因为是隐藏模式,所以看不见vlan 7 和 vlan 8
(3)S3

解释:S3是客户端模式所以可以查看到vlan 7 和vlan 8
(4)S4

解释:S4因为是客户端模式,所以可以查看到vlan 7 和 vlan 8
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号