pvst+_的配置实例
- 格式:doc
- 大小:487.50 KB
- 文档页数:2
PVST协议配置一、实验的目的1、掌握PVST协议的工作原理2、掌握PVST协议的基本配置步骤3、掌握验证PVST协议的基本方法二、实验设备1、四台2950交换机2、五台交叉线3、四条控制线缆三、实验的基本步骤(一)交换机的基本配置1、交换机A的基本配置Switch>enableSwitch#configure terminalSwitch(config)#hostname AA(config)#enable secret 123A(config)#line console 0A(config-line)#password 1234A(config-line)#loginA(config-line)#exitA(config)#2、交换机B的基本配置Switch>enableSwitch#configure terminalSwitch(config)#hostname BB(config)#enable secret 123B(config)#line console 0B(config-line)#password 1234 B(config-line)#loginB(config-line)#endB#3、交换机C的基本配置Switch>enableSwitch#configure terminal Switch(config)#hostname CC(config)#enable secret 123C(config)#line console 0C(config-line)#password 1234 C(config-line)#loginC(config-line)#endC#4、交换机D的基本配置Switch>enableSwitch#configure terminal Switch(config)#hostname DD(config)#enable secret 123D(config)#line console 0D(config-line)#password 1234 D(config-line)#loginD(config-line)#endD#(二)配置VTP协议1、在交换机A上配置VTPA(config)#vtp domain hhA(config)#vtp mode serverA(config)#2、在交换机B上配置VTPB(config)#vtp domain hhB(config)#vtp mode clientB(config)#3、在交换机C上配置VTPC(config)#vtp domain hhC(config)#vtp mode clientC(config)#4、在交换机D上配置VTPD(config)#vtp domain hhD(config)#vtp mode clientD(config)#(三)创建VLAN1、在交换机A上创建VLAN1-5A#vlan databaseA(vlan)#vlan 2 name v2A(vlan)#vlan 3 name v3A(vlan)#vlan 4 name v4A(vlan)#vlan 5 name v5A(vlan)#exit2、配置中继端口:1)交换机A上配置端口f0/22、f0/23、f0/24为中继端口A(config)#interface fastEthernet 0/22A(config-if)#switchport mode trunkA(config-if)#interface fastethernet 0/23A(config-if)#switchport mode trunkA(config-if)#interface fastethernet 0/24A(config-if)#switchport mode trunkA(config-if)#2)在交换机B上配置端口f0/22、f0/23为中继端口B(config)#interface fastEthernet 0/22B(config-if)#switchport mode trunkB(config-if)#interface fastethernet 0/23B(config-if)#switchport mode trunkB(config-if)#3、在交换机A、B、C、D上验证VTP协议的配置情况:在所有交换机上如果都有相同的VLAN配置信息则配置正确;(四)配置PVST1、配置A交换机为VLAN1-2的根交换机:A(config)#spanning-tree vlan 1 root primaryA(config)#spanning-tree vlan 2 root primary3、配置B交换机在VLAN3-4的优先级为4096使起成为VLAN3-4的根交换机:B(config)#spanning-tree vlan 3 priority 4096B(config)#spanning-tree vlan 4 priority 4096B(config)#(五)验证交换PVST配置信息:1、在交换机A上验证PVST配置信息:A#show spanning-tree确认VLAN1和VLAN2的根交换机是否为我们指定的A交换机;四、实验总结1、PVST的工作原理是什么?五、实验思考题。
PVST充分利用带宽,个VLAN 对应一个生成树SW1(vlan)#vlan 2SW1#vlan dataSW1(config)#int fa0/1SW1(config-if)#switch mode trunkSW1(config)#int fa0/2SW1(config-if)#switch mode trunkSW1(config)#spanning-tree vlan 1 priority 4096 配置成VLAN 1为根桥SW1(config)#spanning-tree vlan 2 priority 4096 配置VLAN 2为根桥使得S1中的F0/1 F0/2端口处于指定端口状态就是转发状态=========================================================== SW2#vlan dataSW2(vlan)#vlan 2SW2(config)#int fa0/1SW2(config-if)#switch mode trunkSW2(config)#int fa0/2SW2(config-if)#switch mode trunk==================================================核心部分每个非跟网桥只能有一个跟端口(转发状态)另外一个端口为非指定端口(阻塞状态避免环路)原则:跟端口COST 值越小就是跟端口。
100Mbps 默认值是19 所以在VLAN 1更改一个端口的CONT 使得小于另外一个端口COST值成为跟端口转发则另外一个端口阻塞了这样有点浪费。
在VLAN 2做相反操作。
则2个端口都是转发状态SW2(config)#int f0/1SW2(config-if)#spanning-tree vlan 1 cost 10 修改VLAN1的COST 为10 成为VLAN 1跟端口SW2(config-if)#spanning-tree vlan 2 cost 20 修改COST 为20 成为VLAN 2的非指定端口SW2(config)#int f0/2SW2(config-if)#spanning-tree vlan 1 cost 20 修改VLAN1的COST 为20成为VLAN 1的非指定端口SW2(config-if)#spanning-tree vlan 2 cost 10 修改COST 为20 成为VLAN 2的跟端口SW2#sh spanning-tree bri 查看端口状态==================================================================== VLAN1Spanning tree enabled protocol ieeeRoot ID Priority 4096Address cc00.02f8.0000Cost 10Port 2 (FastEthernet0/1)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32768Address cc00.08b0.0000Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface DesignatedName Port ID Prio Cost Sts Cost Bridge ID Port ID-------------------- ------- ---- ----- --- ----- -------------------- -------FastEthernet0/1 128.2 128 10 FWD 0 4096 cc00.02f8.0000 128.2 FastEthernet0/2 128.3 128 20 BLK 0 4096 cc00.02f8.0000 128.3在VLAN 1中fa0/1是处于转发状态的。
PVST+实验
1、拓扑图
2、实验要求
1)按照vlan实验的要求配置VTP协议,在VTP server上创建vlan 10,vlan 20,vlan30,40,并在三层交换机上配置三层路由实现vlan间通信
2)将pc及分别划分到4个vlan内
3)配置pvst+,将vlan10,vlan30的主根配置在左端三层交换机上,vlan20,vlan40主根配置在右端三层交换机上。
4)查看各vlan的生成树,注意其在各台交换机上根端口及转发端口的情况。
5)验证各台pc机间连通性(同vlan内pc间及跨vlan的pc间)
6)根据第4步骤查看结果,人为断开vlan10及vlan30(或vlan20及vlan40)生成树中链路(跟桥与下层交换机间未被阻塞的链路,可以通过关闭端口的方式来实现)
7)查看vlan生成树的变化情况,重新测试pc间连通性。
并记录结果
8)将二层交换机与左端三层交换机的所有连接断开,查看生成树并测试pc间连通性。
记录结果。
3、思考题
说明你在实验过程中三层路由如何配置的(配置在那台交换机上),执行步骤6和步骤8后,网络连通性如何?如出现不能连通的情况,思考造成这种结果的原因?应该如何解决这个问题。
案例31:配置STP和PVST1. 案例目标通过本案例,你可以掌握如下技能:1)理解STP的工作原理2)掌握STP树的控制3)利用PVST进行负载平衡4)理解portfast的工作场合和配置5)理解bpduguard2. 设备与拓扑设备:1台2950T-24交换机,2台2960交换机,1台PC。
拓扑:如下图。
3. 操作步骤步骤1:按拓扑图配置好交换机的主机名和显示名。
【注意】⏹图中的MAC地址只是参考,后面步骤中3台交换机的MAC地址与你的拓扑不会相同,但只要保证:2950T-24交换机的MAC<右上角的2960<左上角的2960即可。
为此,添加交换机的顺序必须是:(1)2950T-24交换机;(2)右上角的2960;(3)左上角的2960。
⏹PC暂时不要连接步骤2:在3个交换机上创建VLAN 2S1#conf tS1(config)#vlan 2S2#conf tS2(config)#vlan 2S3#conf tS3(config)#vlan 2步骤3:将3个交换机之间的链路都设置为干道(trunk)S1(config)#int f0/13S1(config)#switchport mode trunkS1(config)#int f0/15S1(config)#switchport mode trunkS2(config)#int f0/13S2(config)#switchport mode trunkS2(config)#int f0/15S2(config)#switchport mode trunkS3(config)#int f0/1S3(config)#switchport mode trunkS3(config)#int f0/12S3(config)#switchport mode trunk步骤4:在S1上验证STP已为VLAN 1和VLAN 2启用S1#sh spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 0001.6431.763E //这个地址应该是S3的MAC地址Cost 19Port 15(FastEthernet0/15)Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 00E0.8F3D.9A13Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 20Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/13 Altn BLK 19 128.13 P2pFa0/15 Root FWD 19 128.15 P2pVLAN0002Spanning tree enabled protocol ieeeRoot ID Priority 32770Address 0001.6431.763E //这个地址应该是S3的MAC地址Cost 19Port 15(FastEthernet0/15)Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)Address 00E0.8F3D.9A13Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 20Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/13 Altn BLK 19 128.13 P2pFa0/15 Root FWD 19 128.15 P2pS1#【说明】由S1的输出可知:⏹VLAN 1和VLAN 2的根桥都是S3(MAC:0001.6431.763E)⏹在VLAN 1和VLAN 2中,S1的F0/13端口都是阻塞端口,F0/15端口都是转发端口,即根端口。
三台交换机的P V S T实验【实验目的】1. 理解stp的工作原理;2 利用pvst进行负载平衡。
【实验拓扑】在图中,sw1和sw2模拟核心层的交换机,sw3为接入层的交换机。
sw1和sw2实际上是三层交换机,在本试验中并不使用三层功能。
交换机默认使用pvst。
我们要在网络中配置两个vlan,不同vlan的stp具有不同的根桥,实现负载平衡。
【实验步骤】(1)设备初始化配置把sw1,sw2和sw3的f0/23-24口全部配置成trunk模式,用了传输vlan信息。
(2)配置vtp,SW2为server,SW1和SW3配置为client。
在sw2上配置域名tt并创建vlan10和20。
Sw2(config)#vtp domain ttSw2(config)#vtp mode serverSw2(config)#vlan 10Sw2(config)#vlan 20在Sw1和Sw3上分别配置为vtp client模式。
(配置省略)(3)查看stp的状态信息sw1#show spanning-tree vlan 10Root ID Priority 32778Address 0001.634E.4105This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32778 (priority 32768 sys-id-ext 10)Address 0009.7C9C.C135Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300sw1#show spanning-tree vlan 20Root ID Priority 32788Address 0001.634E.4105This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)Address 0009.7C9C.C135Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300结果显示vlan 10 和vlan 20 都以sw2为根桥。
三层交换(VLAN间互通+路由功能)+VTP+STP(PVST)综合实验【需求分析】本实验采用双核心结构,将三层交换技术和VTP、STP、以太网通道综合一起,实现网络的高速、高性能、高可靠性还有冗余备份功能,主要用于双核心拓扑结构的网络中。
【设计方案】1、在交换机上配置VLAN,控制广播流量2、配置2台三层交换机之间的EthernetChannel,实现三层交换机之间的高速互通3、配置VTP,实现单一平台管理VLAN4、配置STP,实现负载分担5、在三层交换机上配置VLAN间路由,实现不同VLAN之间互通6、通过路由连入外网【设备清单】Cisco 3750 两台,Cisco 2950 四台,Cisco 2611 1台,PC 3台。
【网络拓扑】为了提高可靠性,将网络设计成双核心结构,为保证高性能,采用双核心进行负载分担。
当其中一个核心交换机出现故障的时候,数据能够自动转换到另一台交换机上,启到冗余备份的作用。
注意:本实验中为了测试与外网的连通性,使用了一个简单网络(SW6+PC25)。
【实施方案】一、VLAN的划分和IP地址规划:上连接了一台测试PC25 (IP:172.17.0.1/16 网关:172.17.0.2/16)二、路由器IP地址规划3层交换机上的路由接口(F1/0/1)172.16.1.1/30路由器f0/0接口172.16.1.2/30路由器f0/1接口172.17.0.2/16三、具体试验过程1、配置VTP1.1、首先在三层交换机SW15上配置VTP域名为:tt,模式为server, VTP口令为123456,使用version 2版本,启用vtp修剪功能。
SW15(conffg)#vtp domain ttSW15(conffg)#vtp mode serverSW15(conffg)#vtp v2-mode //在模拟器上无此命令SW15(conffg)#vtp password 123456SW15(conffg)#vtp pruning //在模拟器上无此命令1.2、在SW15上创建vlan100、vlan200、vlan300、vlan400、vlan500、vlan600。
PVST 实验:1、在两交换机上创建VLAN2,并且将两交换机的fa0/23 和fa0/24 设置为trunk。
London#vlan databaseLondon(vlan)#vlan 2London(vlan)#exitLondon#conf tLondon(config)#int fa0/23London(config-if)#switchport trunk encapsulation islLondon(config-if)#switchport mode trunkLondon(config)#int fa0/24London(config-if)#switchport trunk encapsulation islLondon(config-if)#switchport mode trunkFlorence#vlan databaseFlorence(vlan)#vlan 2Florence(vlan)#exitFlorence#conf tFlorence(config)#int fa0/23Florence(config-if)#switchport trunk encapsulation islFlorence(config-if)#switchport mode trunkFlorence(config)#int fa0/24Florence(config-if)#switchport trunk encapsulation islFlorence(config-if)#switchport mode trunk2、在London 上查看show spanning-tree brief 输出:London# show spanning-tree briefVLAN1Spanning tree enabled protocol IEEEROOT ID Priority 4096Address 0007.50b4.0400This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 4096Address 0007.50b4.0400Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Port DesignatedName Port ID Prio Cost Sts Cost Bridge ID Port ID------- ------- ---- ---- --- ---- -------------- -------Fa0/23 128.37 128 19 FWD 0 0007.50b4.0400 128.37 Fa0/24 112.38 112 19 FWD 0 0007.50b4.0400 112.38 VLAN2Spanning tree enabled protocol IEEEROOT ID Priority 32768Address 0006.d759.4901Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768Address 0007.50b4.0401Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Port DesignatedName Port ID Prio Cost Sts Cost Bridge ID Port ID------- ------- ---- ---- --- ---- -------------- -------Fa0/23 128.37 128 19BLK0 0006.d759.4901 128.38 Fa0/24 128.38 128 19 FWD 0 0006.d759.4901 128.37 3、在Florence 上查看show spanning-tree brief 输出:Florence# show spanning-tree briefVLAN1Spanning tree enabled protocol IEEEROOT ID Priority 4096Address 0007.50b4.0400Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority32768Address 0006.d759.4900Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Port DesignatedName Port ID Prio Cost Sts Cost Bridge ID Port ID------- ------- ---- ---- --- ---- -------------- -------Fa0/23 128.37 128 19 BLK 0 0007.50b4.0400 112.38 Fa0/24 128.38 128 18 FWD 0 0007.50b4.0400 128.37 VLAN2Spanning tree enabled protocol IEEEROOT ID Priority 32768Address 0006.d759.4901This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768Address 0006.d759.4901Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Port DesignatedName Port ID Prio Cost Sts Cost Bridge ID Port ID------- ------- ---- ---- --- ---- -------------- -------Fa0/23 128.37 128 19 FWD 0 0006.d759.4901 128.37 Fa0/24 128.38 128 19 FWD 0 0006.d759.4901 128.38 4、通过以上输出,我们可以将目前网络的拓扑总结如下:图2我们希望通过对生成树参数的修改,使网络达到以下状态:图35、对London 的生成树参数进行修改,使其在vlan2 中成为跟网桥。
BCMSN Lab3 验证和配置PVST实验拓扑实验要求1.保证网络中只有一个vlan(vlan1),观察生成树的默认行为2.掌握通过更改端口开销和优先级控制根端口和指定端口的选择3.保证网络有vlan2和vlan3,观察和配置PVST实验步骤实验准备工作:清空交换机的配置和vlan数据库开始实验前清空交换机的配置和vlan数据库并将不必要的端口关掉:#erase startup-configErasing the nvram filesystem will remove all configuration files! Continue? [confirm] [OK] 回车Erase of nvram: complete#delete flash:vlan.datDelete filename [vlan.dat]? 回车Delete flash:vlan.dat? [confirm] 回车SW1#reloadSystem configuration has been modified. Save? [yes/no]: n 选择“no”Proceed with reload? [confirm] 回车关闭交换机的接口:SW1:Fa0/1,Fa0/2,Fa0/15,Fa0/24SW2:Fa0/15,Fa0/20,Fa0/23说明:实验中SW2的型号各不相同,资料中SW2是Catalyst 2950交换机,如果您的交换机是Catalyst 2900XL或是3500XL,使用show spanning-tree时的信息会非常复杂,请使用以下命令检查生成树状态:#show spanning tree brief 检查所有vlan生成树#show spanning tree vlan 2 brief 检查vlan2 的生成树保证网络中只有一个vlan(vlan1),观察生成树的默认行为SW1#show vlan briefVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/24, Gi0/1, Gi0/21002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupSW2#show vlan briefVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/24, Fa0/25, Fa0/26 1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active检查生成树工作状态由于交换机的默认参数一样,所有您的显示和下面的现实是有区别的SW1#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000c.ce01.8f00This bridge is the root -----本交换机根桥Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2p -----该端口是指定端口Fa0/14 Desg FWD 19 128.14 P2p -----该端口是指定端口SW2#show spanning-tree(2900XL和3500XL交换机实用Sw2#show spanning-tree brief )VLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000c.ce01.8f00Cost 19Port 13 (FastEthernet0/13)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000e.84c2.f440Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/13 Root FWD 19 128.13 P2p ------该端口是根端口Fa0/14 Altn BLK 19 128.14 P2p将SW2配置为vlan1的根桥SW2(config)#spanning-tree vlan 1 priority 0SW2(config)#exitSW2#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 1Address 000e.84c2.f440This bridge is the root --发现本交换机变成了根桥Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 1 (priority 0 sys-id-ext 1)Address 000e.84c2.f440Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2pFa0/14 Desg FWD 19 128.14 P2p---所有的端口都是指定端口SW1#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 1 ----发现对方是根桥了Address 000e.84c2.f440Cost 19Port 13 (FastEthernet0/13)Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Root FWD 19 128.13 P2pFa0/14 Altn BLK 19 128.14 P2p根据交换机选择根端口原则,尝试解释为什么Fa0/13口会成为根端口在SW1上将Fa0/14口的STP开销值改为10SW1(config)#interface fastEthernet 0/14SW1(config-if)#spanning-tree vlan 1 cost 10SW1#show running-config interface fastEthernet 0/14Building configuration...Current configuration : 99 bytesinterface FastEthernet0/14switchport mode dynamic desirablespanning-tree vlan 1 cost 10endSW1#show spanning-tree interface fastEthernet 0/14 detailPort 14 (FastEthernet0/14) of VLAN0001 is root forwardingPort path cost 10, Port priority 128, Port Identifier 128.14.Designated root has priority 1, address 000e.84c2.f440Designated bridge has priority 1, address 000e.84c2.f440Designated port id is 128.14, designated path cost 0Timers: message age 1, forward delay 0, hold 0Number of transitions to forwarding state: 2Link type is point-to-point by defaultBPDU: sent 480, received 237SW1#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 1Address 000e.84c2.f440Cost 10Port 14 (FastEthernet0/14)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Altn BLK 19 128.13 P2pFa0/14 Root FWD 10 128.14 P2p发现Fa0/14的开销值改成10,同时Fa0/14口变成了根端口了,因为本网桥到根桥通过Fa0/14口的开销之明显比Fa0/13口小将SW1的Fa0/14口的STP开销值改回19;将SW2的Fa0/14口的端口优先级改成16SW1(config)#interface fastEthernet 0/14SW1(config-if)#no spanning-tree vlan 1 costSW2#show spanning-tree interface fastEthernet 0/14 detail (2900和3500不需要detail)Port 14 (FastEthernet0/14) of VLAN0001 is forwardingPort path cost 19, Port priority 128, Port Identifier 128.14.Designated root has priority 1, address 000e.84c2.f440Designated bridge has priority 1, address 000e.84c2.f440Designated port id is 128.14, designated path cost 0Timers: message age 0, forward delay 0, hold 0Number of transitions to forwarding state: 1Link type is point-to-point by defaultBPDU: sent 379, received 241SW2(config)#interface fastEthernet 0/14SW2(config-if)#spanning-tree vlan 1 port-priority 16SW2#show spanning-tree interface fastEthernet 0/14 detailPort 14 (FastEthernet0/14) of VLAN0001 is forwardingPort path cost 19, Port priority 16, Port Identifier 16.14.Designated root has priority 1, address 000e.84c2.f440Designated bridge has priority 1, address 000e.84c2.f440Designated port id is 16.14, designated path cost 0Timers: message age 0, forward delay 0, hold 0Number of transitions to forwarding state: 1Link type is point-to-point by defaultBPDU: sent 431, received 242由于SW2的Fa0/13口的优先级还是默认的128,Fa0/14的优先级是16,所有Fa0/14的PortID 小于Fa0/13的PortID,导致SW1的Fa0/14口会成为根端口SW1#show spanning-treeVLAN0001Root ID Priority 1Address 000e.84c2.f440Cost 19Port 14 (FastEthernet0/14)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Altn BLK 19 128.13 P2pFa0/14 Root FWD 19 128.14 P2p在交换网络中增加vlan2和vlan3,查看生成树状态SW1(config)#interface range fastEthernet 0/13 - 14SW1(config-if-range)#switchport trunk encapsulation dot1qSW1(config-if-range)#switchport mode trunkSW1(config-if-range)#exitSW1(config)#vtp domain BCMSNSW1(config)#vtp password CCNPSW1(config)#vtp mode serverSW1(config)#vtp version 2SW1(config)#vlan 2SW1(config-vlan)#exitSW1(config)#vlan 3SW1(config-vlan)#exitSW2(config)#interface fastEthernet 0/13SW2(config-if)#switchport mode trunkSW2(config-if)#exitSW2(config)#interface fastEthernet 0/14SW2(config-if)#switchport mode trunkSW2(config-if)#exitSW2#vlan databaseSW2(vlan)#vtp domain BCMSNSW2(vlan)#vtp CCNPSW2(vlan)#vtp password CCNPSW2(vlan)#vtp clientSetting device to VTP CLIENT mode.SW2(vlan)#exitIn CLIENT state, no apply attempted.Exiting....SW1#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Fa0/24, Gi0/1, Gi0/22 VLAN0002 active3 VLAN0003 activeSW2#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/24, Fa0/25, Fa0/262 VLAN0002 active3 VLAN0003 active检查SW1生成树状态概要:SW1#show spanning-tree bridgeHello Max FwdVlan Bridge ID Time Age Dly Protocol---------------- --------------------------------- ----- --- --- --------VLAN0001 32769 (32768, 1) 000c.ce01.8f00 2 20 15 ieee VLAN0002 32770 (32768, 2) 000c.ce01.8f00 2 20 15 ieee VLAN0003 32771 (32768, 3) 000c.ce01.8f00 2 20 15 ieee 说明交换机为每个vlan维护一个生成树,您使用show spanning-tree可以看到每个生成树的状态SW1#show spanning-tree vlan 2VLAN0002Spanning tree enabled protocol ieeeRoot ID Priority 32770Address 000c.ce01.8f00This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32770 (priority 32768 sys-id-ext 2)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2pFa0/14 Desg FWD 19 128.14 P2pSW1#show spanning-tree vlan 3VLAN0003Spanning tree enabled protocol ieeeRoot ID Priority 32771Address 000c.ce01.8f00This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32771 (priority 32768 sys-id-ext 3)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2pFa0/14 Desg FWD 19 128.14 P2p配置不同vlan的生成有优先级,保证SW1是vlan2的根桥,SW2是vlan3的根桥SW1(config)#spanning-tree vlan 2 priority 0SW2(config)#spanning-tree vlan 3 priority 0SW1#show spanning-tree vlan 2VLAN0002Spanning tree enabled protocol ieeeRoot ID Priority 2Address 000c.ce01.8f00This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 2 (priority 0 sys-id-ext 2)Address 000c.ce01.8f00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type------------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2pFa0/14 Desg FWD 19 128.14 P2pSW2#show spanning-tree vlan 3VLAN0003Spanning tree enabled protocol ieeeRoot ID Priority 3Address 000e.84c2.f440This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 3 (priority 0 sys-id-ext 3)Address 000e.84c2.f440Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 15Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/13 Desg FWD 19 128.13 P2pFa0/14 Desg FWD 19 128.14 P2p。
需求描述
四台交换机相连,配置PVST+负载均衡
链路均为100M链路,其中的交换机设备都为默认配置
配置思路:1:在所有设备上配置TRUNK
2: 在sw1上配置VTP 和VLAN 共其他机器学习
3:sw1 – sw2 上配置根网桥
4:sw3 – sw4 上配置速端口
配置命令:
sw1
Switch config)#host s1
Switch config)#int r f0/13 -15 (进入端口i)
s1(config-if-range)#switchport mode trunk (配置trunk)
s1(config-if-range)#exit
s1(vlan)#vtp domain yu (VTP 域名其他设备配置方法一样)
s1(vlan)#vlan
s1(vlan)#vlan 2 name xiaoshou (配置vlan)
s1(vlan)#vlan 3 name shengchan
s1(vlan)#vlan 4 name shouhou
s1(config)#spanning-tree vlan 1 root primary (配置根端口)
s1(config)#spanning-tree vlan 2 root primary
s1(config)#spanning-tree vlan 3 root secondary
s1(config)#spanning-tree vlan 4 root secondary
sw2
s2(config)#int r f0/13 -15 (进入端口)
s2(config-if-range)#switchport mode trunk (配置trunk)
s2(config)#spanning-tree vlan 1 root secondary(配置根端口)
s2(config)#spanning-tree vlan 2 root secondary
s2(config)#spanning-tree vlan 3 root primary
s2(config)#spanning-tree vlan 4 root primary
sw3
s3(config)#vlan 1
s3((config-vlan)#exit
s3(config)#vlan 2
s3((config-vlan)#exit
s3(config)#vlan3
s3((config-vlan)#exit
s3(config)#vlan 4
s3((config-vlan)#exit
s3(config)#int r f0/14 -15 (进入端口)
s3(config-if-range)#switchport mode trunk (配置trunk)s3(config)#int r f0/0 -12
s3(config-if-range)#spanning-tree portfast(配置速端口)
sw4 (与sw3 设置相
show spanning-tree bridge (查看生成树)。