天天看点

VTP协议与配置(小实验详细步骤、思路)

一、在中间两个交换机配置trunk

VTP协议与配置(小实验详细步骤、思路)
1> 配置命令 :
Switch>enable(进入特权模式)
Switch#configure terminal (进入全局配置模式)
Switch(config)#interface range f0/1 - 2  (进入F0/1 -2 接口)
Switch(config-if-range)#switchport mode trunk(将接口模式改为trunk)
           
VTP协议与配置(小实验详细步骤、思路)
VTP协议与配置(小实验详细步骤、思路)
2> 配置命令思路:
switch 2 同switch 1 操作相同
当两个交换机一边有trunk 
则整条线都为trunk
所以当连接了中间的两个交换机后
三条线都为trunk
           

二、当配置好中间的交换机时,查看两边的交换机是否变为trunk

3>查看交换机配置:(两边交换机都要用此命令查看)
Switch>enable (进入特权模式)
Switch#show interfaces f0/1 switchport(显示接口f0/1 交换机端口)
Name: Fa0/1
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: trunk(运行模式:中继)

<完成>
           
VTP协议与配置(小实验详细步骤、思路)

三、创建VTP

实验图:

VTP协议与配置(小实验详细步骤、思路)
4><switch 0 服务器>配置成同一个域:
Switch>enable (进入特权模式)
Switch#configure terminal (进入全局配置模式)
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vtp domain wh(创建VTP域命令)
Changing VTP domain name from NULL to wh(将VTP域名从NULL更改为wh)
Switch(config)#vtp mode server (配置交换机的VTP模式 -- 服务器)
Device mode already VTP SERVER.(设备模式已经是VTP服务器)
Switch(config)#vtp version 1(配置vtp版本)
VTP mode already in V1.(VTP模式已经在V1中)
Switch(config)#vtp password 888.com(配置vtp密码)
Setting device VLAN database password to 888.com(正在将设备VLAN数据库密码设置为888.com)

<switch 0 完成>
           
5><switch 1 透明模式>配置成同一个域:
Switch>enable (进入特权模式)
Switch#configure terminal (进入全局配置模式)
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vtp domain wh(创建VTP域命令)
Domain name already set to wh.(将VTP域名从NULL更改为wh)
Switch(config)#vtp mode transparent (配置交换机的VTP模式 -- 透明)
Setting device to VTP TRANSPARENT mode.(将设备设置为VTP透明模式)
Switch(config)#vtp version 1(配置vtp版本)
VTP mode already in V1.(VTP模式已经在V1中)
Switch(config)#vtp password 888.com(配置vtp密码)
Setting device VLAN database password to 888.com(正在将设备VLAN数据库密码设置为888.com)

<switch 1 完成>
           
6><switch 2 客户机模式>配置成同一个域:
Switch>enable (进入特权模式)
Switch#configure terminal (进入全局配置模式)
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vtp domain wh(创建VTP域命令)
Domain name already set to wh.(将VTP域名从NULL更改为wh)
Switch(config)#vtp version 1(配置vtp版本)
VTP mode already in V1.(VTP模式已经在V1中)
Switch(config)#vtp password 888.com(配置vtp密码)
Setting device VLAN database password to 888.com(正在将设备VLAN数据库密码设置为888.com)
Switch(config)#vtp mode client (配置交换机的VTP模式 -- 客户机)
Setting device to VTP CLIENT mode.(正在将设备设置为VTP客户端模式)


<switch 2完成>
           
7>实验思路:
 查看switch 2 客户机 vlan:
 Switch#show vlan brief (查看vlan信息)
 信息里除了默认vlan,没有其他vlan.
-------------------------
 8>在switch 0 服务器中创建vlan:
 Switch#configure terminal (进入全局配置模式)
 Enter configuration commands, one per line.       End with CNTL/Z.
 Switch(config)#vlan 10(创建vlan)
 Switch(config-vlan)#vlan 20(创建vlan)
 Switch(config-vlan)#vlan 30(创建vlan)
 -----------------------
 
 Switch(config-vlan)#end(保存并退出)
 Switch#
 %SYS-5-CONFIG_I: Configured from console by console

Switch#show vlan brief(查看vlan信息,确定新创建的vlan已存在)
9>在switch 1 透明模式中输入:
 Switch#show vlan brief(查看vlan信息,发现没有学到服务器的vlan信息)
10>在switch 2 客户机模式中输入:
Switch#show vlan brief(查看vlan信息,发现学到服务器的vlan信息)
尝试删除vlan 20:
Switch(config)#no vlan 20(删除vlan 20)
VTP VLAN configuration not allowed when device is in CLIENT mode.(当设备处于客户端模式时,不允许进行VTP VLAN配置)
 

<实验测试完成>
           
注意:
域名、密码不同都不行
           

继续阅读