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
Enter configuration commands, one per line. End with CNTL/Z.
4 Switch(config)#int fa0/1
5 Switch(config-if)#switch mode trunk Switch(config-if)#
%LINEPROTO--UPDOWN: Line protocol on Interface FastEthernet0/, changed state to down %LINEPROTO--UPDOWN: Line protocol on Interface FastEthernet0/, changed state to up

第二步:设置vtp server

1 Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode. 6 Switch(vlan)#vtp server
Device mode already VTP SERVER.
8 Switch(vlan)#vtp domain hist
Changing VTP domain name from NULL to hist

第三步:在server上添加vlan

1 Switch(vlan)#vlan 2 name v2
VLAN added:
Name: v2
4 Switch(vlan)#vlan 3 name v3
VLAN added:
Name: v3

第四步:将相应端口添加到相应的vlan

1 Switch#conf t
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
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode. 7 Switch(vlan)#vtp client
Setting device to VTP CLIENT mode.

检测vtp client配置成功!

在客户端输入以下命令检测配置成功:

1 Switch(vlan)#vlan 100 name v100
Apply not allowed when device is in CLIENT state.

到此,简单的vtp下发工作已经完成,配置了vtp后,就形成了C/S模式,此后,在server端配置的任何vlan都会自动下发到其他的交换机!

========================结束========================

05-08 15:33