VTP的配置步骤:
- 配置Trunk
- 配置VTP DOMAIN
- 配置VTP MODE
- 配置封装 switchport trunk encapsulation dot1q
- 配置密码 vtp password
- 配置VLAN
- 将端口加入VLAN
- 检查vtp
配置SW1:
SW1#configure terminal
SW1(config)#interface fastEthernet 0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#vtp domain testvtp
Domain name already set to testvtp.
SW1(config)#vtp mode server
Device mode already VTP SERVER.
SW1(config)#vtp password cisco
Setting device VLAN database password to cisco
SW1(config)#vtp pruning //配置VTP的修剪,只要在SERVER端配置就行.
Pruning switched on
(vtp修剪默认是关闭的,在交换机发送vtp报文更新的时候会向交换机上所有的TRUNK端口去发送,VTP修剪是为了修剪掉那些广播、组播以及未知目的地址的单播流量,不让这些流量发送到不包含流量的源VLAN的交换机)
SW1#sho vtp status
创建VLAN2 VLAN3 VLAN4 VLAN5
配置SW2:
Switch#
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#int fastEthernet 0/1
SW2(config-if)#switchport trunk encapsulation dot1q //如果是3550端口先要封装dot1q,因为默认为auto时不可以直接设置端口的trunk模式
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#vtp domain testvtp
Changing VTP domain name from test to testvtp
SW2(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW2(config)#vtp password cisco
SW2#show vlan
SW2不用配置VLAN,同步了SW1的VLAN信息