实验步骤:
SA配置:
使用VTP协议建立VLAN10-100
减少在其他交换机中一一配置VLAN信息;
Router>en
Router#config t
Router#vlan database
Router(vlan)#exit
Router#cofnig
Router#configure terminal
Router(config)#hostname SA
SA(config)#exit
SA#vlan database
SA(vlan)#vtp domain zixu
SA(vlan)#vtp server
SA(vlan)#exit
SA#config terminal
SA(config)#interface range f0/1 - 2,f0/12 - 13
SA(config-if-range)#switchport mode trun
将端口1、2、12、13做中继链路
SA(config-if-range)#switchport trunk encapsulation dot1q 协议封装默认
SA(config-if-range)#exit
SA(vlan)#vlan 10
SA(vlan)#vlan 20
SA(vlan)#vlan 30
SA(vlan)#vlan 40
SA(vlan)#vlan 50
SA(vlan)#vlan 60
SA(vlan)#vlan 70
SA(vlan)#vlan 80
SA(vlan)#vlan 90
SA(vlan)#vlan 100
SA(vlan)#exit
SA(config)#spanning-tree vlan 10 root primary 将VLAN10-50设置SA为根
SA(config)#spanning-tree vlan 20 root primary
SA(config)#spanning-tree vlan 30 root primary
SA(config)#spanning-tree vlan 40 root primary
SA(config)#spanning-tree vlan 50 root primary
SA(config)#spanning-tree vlan 60 priority 409
将VLAN60-100设置SB次根
SA(config)#spanning-tree vlan 60 priority 4096 实现冗余性
SA(config)#spanning-tree vlan 70 priority 4096
SA(config)#spanning-tree vlan 80 priority 4096
SA(config)#spanning-tree vlan 90 priority 4096
SA(config)#spanning-tree vlan 100 priority 4096
SA(config)#
SA(config)#interface range f0/1 �C 2 将端口1和2做以太网捆绑链路
SA(config-if-range)#channel-group 1 mode on
SA(config-if-range)#exit
SA(config)#
SA(config)#interface f0/13
将端口13停用
SA(config-if)#shutdown
SB配置:
Router>en
Router#config t
Router#vlan database
Router(vlan)#exit
Router#cofnig
Router#configure terminal
Router(config)#hostname SB
SB(config)#exit
SB#vlan database
SB(vlan)#vtp domain zixu
SB(vlan)#vtp server
SB#config terminal
SB(config)#interface range f0/1 - 2,f0/12 - 13
SB(config-if-range)#switchport mode trun将端口1、2、12、13做中继链路
SB(config-if-range)#switchport trunk encapsulation dot1q
协议封装默认
SB(config-if-range)#exit
SB(config)#spanning-tree vlan 10 priority 4096将VLAN10-50设置SA次根
SB(config)#spanning-tree vlan 20 priority 4096
实现冗余性
SB(config)#spanning-tree vlan 30 priority 4096
SB(config)#spanning-tree vlan 40 priority 4096
SB(config)#spanning-tree vlan 50 priority 4096
SB(config)#spanning-tree vlan 60 root primary 将VLAN60-100设置SA次根
SB(config)#spanning-tree vlan 70 root primary
SB(config)#spanning-tree vlan 80 root primary
SB(config)#spanning-tree vlan 90 root primary
SB(config)#spanning-tree vlan 100 root primary
SB#configure terminal
SB(config)#interface range f0/1 �C 2将端口1和2做以太网捆绑链路
SB(config-if-range)#channel-group 1 mode on
SB(config-if-range)#exit
SB(config)#
SC配置:
Router>en
Router#config t
Router#vlan database
Router(vlan)#exit
Router#cofnig
Router#configure terminal
Router(config)#hostname SC
SC(config)#exit
SC#vlan database
SC(vlan)#vtp domain zixu
SC(vlan)#vtp server
SC(config)#interface range f0/12 �C 13
SC(config-if-range)#switchport mode trun将端口1、2、12、13做中继链路
SC(config-if-range)#switchport trunk encapsulation dot1q协议封装默认
SC(config)#spanning-tree uplinkfast 配置上行速链路
SC(config-if)#spanning-tree portfast 配置素端口
SD配置:
Router>en
Router#config t
Router#vlan database
Router(vlan)#exit
Router#cofnig
Router#configure terminal
Router(config)#hostname SD
SD(config)#exit
SD#vlan database
SD(vlan)#vtp domain zixu
SD(vlan)#vtp server
SD(config)#interface range f0/12 �C 13
SD(config-if-range)#switchport mode trun将端口1、2、12、13做中继链路
SD(config-if-range)#switchport trunk encapsulation dot1q协议封装默认
SD(config)#spanning-tree uplinkfast 配置上行速链路
SD(config-if)#spanning-tree portfast 配置素端口
以下是各种查询结果:
以太网链路捆绑
SA#show etherchannel 1 summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa0/1(P) Fa0/2(P)
SB#show etherchannel 1 summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa0/1(P) Fa0/2(P)
查询学习VLAN结果
10 enet 100010 1500 - - - - - 0
0
20 enet 100020 1500 - - - - - 0
0
30 enet 100030 1500 - - - - - 0
0
40 enet 100040 1500 - - - - - 0
0
50 enet 100050 1500 - - - - - 0
0
60 enet 100060 1500 - - - - - 0
0
70 enet 100070 1500 - - - - - 0
0
80 enet 100080 1500 - - - - - 0
0
90 enet 100090 1500 - - - - - 0
0
100 enet 100100 1500 - - -
测试结果 :
VPCS 2 >1
VPCS 1 >ping 1.1.1.2
1.1.1.2 icmp_seq=1 time=5.000 ms
1.1.1.2 icmp_seq=2 time=47.000 ms
1.1.1.2 icmp_seq=3 time=14.000 ms
1.1.1.2 icmp_seq=4 time=2.000 ms
1.1.1.2 icmp_seq=5 time=10.000 ms
VPCS 1 >ping 1.1.1.1
1.1.1.1 icmp_seq=1 time=0.001 ms
1.1.1.1 icmp_seq=2 time=0.001 ms
1.1.1.1 icmp_seq=3 time=0.001 ms
1.1.1.1 icmp_seq=4 time=0.001 ms
1.1.1.1 icmp_seq=5 time=0.001 ms
SA和SB所有端口为Forword
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/1 128.2 128 19 FWD 0 4095 cc00.0f28.000a 128.2
FastEthernet0/2 128.3 128 19 FWD 0 4095 cc00.0f28.000a 128.3
FastEthernet0/12 128.13 128 19 FWD 0 4095 cc00.0f28.000a 128.13
FastEthernet0/13 128.14 128 19 FWD 0 4095 cc00.0f28.000a 128.14