上图是实验拓扑图:
实验要求
1.Switch配置:
1.建VTP,DSW2=server,domain=ccna,password=cisco
2.建TRUNK,f1/0-1上做etherchannel 1,做trunk
3.验证VTP,在DSW2上创建vlan 10和vlan 20,在sw1查看结果。
4.将端口指定到VLAN里,vpc1/3-->V10 ,vpc2/4-->v20
5.关闭其他所有不传数据端口
2.PC配置
1.将路由器配置为pc,no ip routing
2.在端口f0/0,配vpc1=172.16.1.1/24 ;vpc2=172.16.2.1/24
vpc3=172.16.1.10/24 ;vpc4=172.16.2.10/24
测试。
首先对DSW1进行配置:
Router#vlan data
Router(vlan)#vtp domain ccna
Changing VTP domain name from NULL to ccna
Router(vlan)#pass
Router(vlan)#password
Router(vlan)#vtp pass
Router(vlan)#vtp password cisco
Setting device VLAN database password to cisco.
Router(vlan)#vtp client
DSW1(config)#int range f1/0 -1
DSW1(config-if-range)#chan
DSW1(config-if-range)#channel-group 1 mode on
Creating a port-channel interface Port-channel1
DSW1(config-if)#switchport mode trunk
DSW1(config)#int f1/10
DSW1(config-if)#sw
DSW1(config-if)#switchport acc vlan 10
DSW1(config-if)#int f1/11
DSW1(config-if)#swit
DSW1(config-if)#switchport acc
DSW1(config-if)#switchport access vlan 20
DSW1(config-if)#exit
DSW1#sh vlan-s
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/2, Fa1/3, Fa1/4, Fa1/5
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/12, Fa1/13, Fa1/14, Fa1/15
10 VLAN0010 active Fa1/10
20 VLAN0020 active Fa1/11
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - 0 - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
其次DSW2配置:
DSW2#vlan data
DSW2(vlan)#vtp
% Incomplete command.
DSW2(vlan)#vtp domain ccna
Changing VTP domain name from NULL to ccna
DSW2(vlan)#vtp pass cisco
Setting device VLAN database password to cisco.
DSW2(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
DSW2(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
DSW2(vlan)#exit
DSW2(config)#int range f1/0 -1
DSW2(config)#int port-channel ?
<1-64> Port-channel interface number
DSW2(config)#int port-channel 1
DSW2(config-if)#switch
DSW2(config-if)#switchport mode trunk
DSW2#sh vlan-s
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/2, Fa1/3, Fa1/4, Fa1/5
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/12, Fa1/13, Fa1/14, Fa1/15
10 VLAN0010 active Fa1/10
20 VLAN0020 active Fa1/11
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
配置pc的ip地址
测试
注意:在实际配置中,两台交换机之间做中继是需要封装的。
配置vtp的时候一定要注意配置完vtp的时候不要按ctrl-z直接回到#模式,
那样会照成vtp的配置不生效,回退到#模式,只要敲入exit命令就可以