实验拓扑

图1-1

实验需求

  1. 开启所有设备,等待STP收敛后观察STP状态
  2. 使asw04成为根网桥
  3. 使闭塞端口出现在asw02上
  4. 把asw01上连接的PC的端口配置为边缘端口

实验解法

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

步骤1:根据HCL模拟器的运行机制,asw01的Mac地址应该是最小的,会成为根网桥,在asw01上查看STP运行状态,确认asw01为根网桥

[asw01]display stp
-------[CIST Global Info][Mode MSTP]-------
Bridge ID           : 32768.7aef-e4ea-0100
Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC        : 32768.7aef-e4ea-0100, 0
RegRoot ID/IRPC     : 32768.7aef-e4ea-0100, 0
RootPort ID         : 0.0
BPDU-Protection     : Disabled
Bridge Config-
Digest-Snooping     : Disabled
TC or TCN received  : 7
Time since last TC  : 0 days 0h:0m:40s

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

[asw04]display stp brief 
MST ID   Port                                Role  STP State   Protection
0        GigabitEthernet1/0/1                ROOT  FORWARDING  NONE
0        GigabitEthernet1/0/2                ALTE  DISCARDING  NONE

2.使asw04成为新的根网桥

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

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

[asw04]stp priority 4096
[asw04]%Mar 21 20:50:27:109 2018 SW4 STP/6/STP_DETECTED_TC: Instance 0's port GigabitEthernet1/0/2 detected a topology change.

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

[asw04]display stp 
-------[CIST Global Info][Mode MSTP]-------
Bridge ID           : 4096.7af0-0e17-0400
Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC        : 4096.7af0-0e17-0400, 0
RegRoot ID/IRPC     : 4096.7af0-0e17-0400, 0
RootPort ID         : 0.0
BPDU-Protection     : Disabled
Bridge Config-
Digest-Snooping     : Disabled
TC or TCN received  : 8
Time since last TC  : 0 days 0h:1m:30s

3.使闭塞端口出现在asw02上

分析:asw04成为了根网桥,按照STP计算机制,闭塞端口此时应该在asw01上。要使闭塞端口到asw02上,就需要让asw02到asw01的cost比asw04到asw01更大。H3C交换机千兆口的cost默认是20,我们可以把asw02的GE_1/0/2接口的cost改为1000

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

[asw02]interface g1/0/2
[asw02-GigabitEthernet1/0/2]stp cost 1000
[asw02-GigabitEthernet1/0/2]%Mar 21 22:16:05:399 2018 SW2 STP/6/STP_NOTIFIED_TC: Instance 0's port GigabitEthernet1/0/1 was notified a topology change.

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

[asw02]display stp brief 
MST ID   Port                                Role  STP State   Protection
0        GigabitEthernet1/0/1                ROOT  FORWARDING  NONE
0        GigabitEthernet1/0/2                ALTE  DISCARDING  NONE

4.把asw01连接PC的所有接口配置为边缘接口

[asw04]interface g1/0/3
[asw04-GigabitEthernet1/0/3]stp edged-port 
Edge port should only be connected to terminal. It will cause temporary loops if port GigabitEthernet1/0/3 is connected to bridges. Please use it carefully.
[asw04]interface g1/0/4
[asw04-GigabitEthernet1/0/4]stp edged-port 
Edge port should only be connected to terminal. It will cause temporary loops if port GigabitEthernet1/0/4 is connected to bridges. Please use it carefully.
最后修改:2022 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏