server模式——服务器模式,在该模式下可以建立vlan,删除vlan,该模式下的vlan可以下发到其他的交换机
client模式——客户端模式,被动模式。交换机可以接受从server模式下传来的vlan,但是不能建立和删除vlan
transparent模式——透明模式,指的是彼此不交互vlan数据库信息
C/S S/S(共享) T-T C/S/T——T/S/C
第一步:把fa0/1做成trunk口。
1 Switch>enable 2 Switch#conf t 3 Enter configuration commands, one per line. End with CNTL/Z. 4 Switch(config)#int fa0/1 5 Switch(config-if)#switch mode trunk 6 7 Switch(config-if)# 8 %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down 9 10 %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
第二步:设置vtp server
1 Switch#vlan database 2 % Warning: It is recommended to configure VLAN from config mode, 3 as VLAN database mode is being deprecated. Please consult user 4 documentation for configuring VTP/VLAN in config mode. 5 6 Switch(vlan)#vtp server 7 Device mode already VTP SERVER. 8 Switch(vlan)#vtp domain hist 9 Changing VTP domain name from NULL to hist
第三步:在server上添加vlan
1 Switch(vlan)#vlan 2 name v2 2 VLAN 2 added: 3 Name: v2 4 Switch(vlan)#vlan 3 name v3 5 VLAN 3 added: 6 Name: v3
第四步:将相应端口添加到相应的vlan
1 Switch#conf t 2 Enter configuration commands, one per line. End with CNTL/Z. 3 Switch(config)#int fa0/2 4 Switch(config-if)#switch acc vlan 2 5 Switch(config-if)#int fa0/3 6 Switch(config-if)#switch acc vlan 3
第五步:配置vtp客户端(client)【在另外一台交换机配置】
1 Switch>enable 2 Switch#vlan database 3 % Warning: It is recommended to configure VLAN from config mode, 4 as VLAN database mode is being deprecated. Please consult user 5 documentation for configuring VTP/VLAN in config mode. 6 7 Switch(vlan)#vtp client 8 Setting device to VTP CLIENT mode.
检测vtp client配置成功!
在客户端输入以下命令检测配置成功:
1 Switch(vlan)#vlan 100 name v100 2 Apply not allowed when device is in CLIENT state.
到此,简单的vtp下发工作已经完成,配置了vtp后,就形成了C/S模式,此后,在server端配置的任何vlan都会自动下发到其他的交换机!
========================结束========================