生成树协议STP案例小实验

实验拓扑

生成树协议STP案例小实验


实验需求

1、开启所有设备,等待STP收敛后观察STP状态

2、使SW1成为根桥

3、使阻塞端口出现在SW3

4、把SW1上连接的PC的端口配置边缘端口

实验操作步骤

1、等待STP收敛后,查看STP运行状态,找出根网桥,闭塞端口。

步骤1:根据观察各交换机的MAC地址,发现SW3的MAC地址是最小的,会成为根网桥,在SW1上查看STP运行状态,确认SW3为根网桥.

<code>[SW3]display stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge :32768.4c1f-cc23-3286
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.4c1f-cc23-3286 / 0
CIST RegRoot/IRPC :32768.4c1f-cc23-3286 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :10
TC count per hello :0
STP Converge Mode :Normal
Time since last TC :0 days 0h:2m:43s/<code>

步骤2:根据STP计算机制,所有链路开销一致,阻塞端口应该出现在SW1上。在SW1查看端口状态,确认SW1的g0/0/2被阻塞。

<code>[SW1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
0 GigabitEthernet0/0/2 ALTE DISCARDING NONE/<code>

2、使SW1成为新的根网桥。

要想使SW1成为根网桥,最好的办法就是让SW1的优先级成为全网最小。默认优先级都为32768,只要把SW1的优先级改成比32768小就可以了.

步骤1:修改SW1的优先级为4096

<code>[SW1]stp priority 4096
Oct 9 2020 21:36:37-08:00 SW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095./<code>

步骤2:在SW1上查看STP运行状态,发现SW1已经成为新的根网桥.

<code>[SW1]display stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge :4096 .4c1f-ccc9-3575
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .4c1f-ccc9-3575 / 0
CIST RegRoot/IRPC :4096 .4c1f-ccc9-3575 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled/<code>

3、使闭塞端口出现在SW3上的g0/0/1上。

步骤1:在SW3上进入g1/0/2接口的接口视图,修改stp cost为1000

<code>[SW3]interface GigabitEthernet 0/0/2
[SW3-GigabitEthernet0/0/2]stp cost 1000/<code>

步骤2:在SW2上查看STP接口状态,发现SW2的g1/0/2接口已经成为了新的闭塞端口

<code>[SW3-GigabitEthernet0/0/2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 ALTE DISCARDING NONE
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE/<code>

4、把SW3连接PC的所有接口配置为边缘接口

<code>[SW3]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4
[SW3-GigabitEthernet0/0/3]stp edged-port enable
[SW3-GigabitEthernet0/0/4]stp edged-port enable/<code>


分享到:


相關文章: