步骤3:检查设备角色状态是否变化
1.在核心网关设备上查看端口的角色是否有频繁的变化。通过show
spanning-tree interface XX命令:
查看show spanning-tree interface显示信息的方法,以gi0/24显示的信息做讲解
Switch#show spanning-tree int gi 0/24
PortAdminPortFast : Disabled
PortOperPortFast : Disabled
PortAdminLinkType : auto
PortOperLinkType : point-to-point <-----p2p表示全双工,如果是shared则表示半双工
PortBPDUGuard : disable
PortBPDUFilter : disable
###### MST 0 vlans mapped :1, 3-4094
PortState : forwarding <-----当前端口在instance0里面的转发状态
PortPriority : 128
PortDesignatedRoot : 8000.00d0.f822.3caa <-----该端口学习到的instance0的总根桥(注意,不是域根桥)
PortDesignatedCost : 0
PortDesignatedBridge :8000.00d0.f822.3caa <----该端口在instance0中的上游网桥
PortDesignatedPort : 8018ß该端口在instance0中的上游端口,该值共16bit,其中前四个bit表示上游端口的优先级/16,后12bit表示上游端口的索引值,他们都用16近制表示。端口的索引值的查看请使用show
interface命令查看。在例子里面该值就表示上游端口的优先级为十近制的128,上游端口的索引值为十近制的24
PortForwardTransitions : 2
PortAdminPathCost : 200000
PortOperPathCost : 200000
PortRole : designatedPortß该端口在instance0中的角色
###### MST 1 vlans mapped :2
PortState : forwardingß该端口在instance1中的转发状态
PortPriority : 128
PortDesignatedRoot : 0001.00d0.f822.3caaß该端口在instance1中学习到的根桥
PortDesignatedCost : 0
PortDesignatedBridge :0001.00d0.f822.3caaß该端口在instance1中的上游根桥
PortDesignatedPort : 8018
PortForwardTransitions : 1
PortAdminPathCost : 200000
PortOperPathCost : 200000
PortRole : designatedPortß该端口在instance1中的角色
2.如果出现端口角色频繁变化,建议打开debug
mstp topology调试命令并收集相关信息进行分析,进一步定位。
注意:DEBUG操作可能存在风险(最坏情况可能需要重启设备才能恢复),需要客户知晓风险并同意后才能收集,建议在低峰期操作!若故障排查还需要抓包,DEBUG和抓包最好同时收集!
&说明:
Debug mstp topochange:
mstp的拓扑变换调试信息。利用该调试命令,可以跟踪当前设备的mstp发生了什么样的拓扑变换。可跟踪的拓扑变化包括:端口的角色变化、端口的转发状态变化、端口的mac表删除动作、在哪个实例里发生变化以及在哪些端口接收到了带tc标记的BPDU报文。
例如我们将一台pc直连到开启了mstp的设备gi0/24端口,通过debug
mstp topochange打印了如下信息:
1:14:58:56 S2924G: %7:mstp topo:GigabitEthernet 0/24 select role DesignatedPort in msti 0!
<-----该端口被选为instance0里面的DesignatedPort
1:14:58:56 S2924G: %7:mstp topo:ssp port state notify.set port GigabitEthernet
0/24 state 2,mstid 0 <-----设置该端口在instance
0里面的转发状态为2,也就是learning状态
1:14:58:56 S2924G: %7:mstp topo:ssp port state notify.set port GigabitEthernet
0/24 state 2,mstid 1 <------设备该端口在instance1中的转发状态为learning
1:14:59:11 S2924G: %7:mstp topo:port[GigabitEthernet 0/24] change state
discarding to forwarding <-----该端口进入forwarding状态
1:14:59:11 S2924G: %7:mstp topo:ssp port state notify.set port GigabitEthernet
0/24 state 3,mstid 0 <-----更新为转发状态,3表示的就是转发状态
1:14:59:11 S2924G: %7:mstp topo:port[GigabitEthernet 0/24] change state
discarding to forwarding
1:14:59:11 S2924G: %7:mstp topo:ssp port state notify.set port GigabitEthernet
0/24 state 3,mstid 1
1:14:59:12 S2924G: %7:2007-1-12 10:28:40 topochange:topology is changed <-----到这里界面才打印拓扑变化