网络拓扑图
交换机信息
交换机1信息:
<H3C>dis stp
-------[CIST Global Info][Mode MSTP]-------
Bridge ID : 32768.06fd-8165-0100
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 0.08c0-212c-0ff0, 22002
RegRoot ID/IRPC : 32768.06fd-8165-0100, 0
RootPort ID : 128.51
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 10
Time since last TC : 0 days 0h:3m:17s
交换机2信息:
<H3C>dis stp
-------[CIST Global Info][Mode MSTP]-------
Bridge ID : 32768.06fd-8651-0200
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 0.08c0-212c-0ff0, 22022
RegRoot ID/IRPC : 32768.06fd-8651-0200, 0
RootPort ID : 128.2
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 11
Time since last TC : 0 days 0h:4m:45s
交换机3信息
<H3C>display stp
-------[CIST Global Info][Mode MSTP]-------
Bridge ID : 32768.06fd-8d6a-0300
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 0.08c0-212c-0ff0, 22022
RegRoot ID/IRPC : 32768.06fd-8d6a-0300, 0
RootPort ID : 128.4
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 18
Time since last TC : 0 days 0h:5m:28s
交换机4信息
<H3C>display stp
-------[CIST Global Info][Mode MSTP]-------
Bridge ID : 32768.06fd-93dc-0400
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 0.08c0-212c-0ff0, 22022
RegRoot ID/IRPC : 32768.06fd-93dc-0400, 0
RootPort ID : 128.2
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 20
Time since last TC : 0 days 0h:5m:52s
根桥判断
交换机1:32768.06fd-8165-0100
交换机2:32768.06fd-8651-0200
交换机3:32768.06fd-8d6a-0300
交换机4:32768.06fd-93dc-0400
从上面比较可以看出“交换机1”的网桥ID最小,因此此交换机将作为网桥的“根”。
检测端口
交换机1
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
0 Ten-GigabitEthernet1/0/50 ROOT FORWARDING NONE
交换机2:
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
交换机3
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
0 Ten-GigabitEthernet1/0/50 DESI FORWARDING NONE
交换机4
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
0 GigabitEthernet1/0/3 ALTE DISCARDING NONE
标记端口
ALT,意味着端口是有STP协议关闭的。
最后结果
去掉ALTE标记所在线路,最终结果如下:
模拟断路
手动关闭交换机4上的G1/01端口
[H3C-GigabitEthernet1/0/1]shu
[H3C-GigabitEthernet1/0/1]shutdown
接下来会出现一些提示信息
%Sep 1 10:43:12:614 2023 H3C STP/6/STP_DETECTED_TC: Instance 0's port GigabitEthernet1/0/3 detected a topology change.
%Sep 1 10:43:12:616 2023 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Sep 1 10:43:12:616 2023 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
检查线路
交换机1
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
0 Ten-GigabitEthernet1/0/50 ROOT FORWARDING NONE
变为:
<H3C>dis stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
0 Ten-GigabitEthernet1/0/50 ROOT FORWARDING NONE
GigabitEthernet1/0/2 端口没有信息,也就是“物理断开了”
交换机2:
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
交换机3
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
0 Ten-GigabitEthernet1/0/50 DESI FORWARDING NONE
交换机4
<H3C>display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
0 GigabitEthernet1/0/3 ALTE DISCARDING NONE
改变为:
[H3C]dis stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
GigabitEthernet1/0/1 线路“物理断开”了,
GigabitEthernet1/0/3 变成了ROOT