工业互联网(Industrial Internet of Things, IIoT)是指将传统工业环境与物联网技术、云计算、大数据分析以及人工智能等先进技术相结合,实现设备间互联互通,提升生产效率和决策能力的新型基础设施。工业互联网的组建主要包括以下几个关键步骤:
-
网络基础设施:部署高速、低延迟的网络,如工业以太网、无线网络(如LoRa、5G等),以便设备间实时数据交换。
-
智能设备连接:安装各种传感器和执行器,实现设备的远程监控和控制,如PLC、SCADA系统和工业级路由器。
-
边缘计算:在工厂内部或接近现场的地方设置边缘计算节点,处理实时数据并减轻云端压力。
-
平台集成:构建工业互联网平台,如MES(制造执行系统)、ERP(企业资源计划)和SCADA( Supervisory Control and Data Acquisition),整合来自不同设备的数据。
-
安全措施:实施严格的网络安全策略,保护工业数据不被未经授权的访问或攻击。
维护方面,工业互联网的维护包括:
- 数据质量保证:定期检查设备状态,确保数据准确无误。
- 系统监控:通过日志分析、异常检测工具,及时发现并解决问题。
- 更新升级:对软件和固件进行定期更新,修复漏洞和增强功能。
- 网络安全维护:定期进行安全审计,防范黑客入侵和内部威胁。
- 培训与支持:为操作人员提供必要的培训,帮助他们理解和操作新系统。
STP(Spanning Tree Protocol)是一种网络协议,用于解决以太网中的环路问题,确保网络中的数据包能够正确传输。在交换式以太网中,如果没有STP,可能会形成多个回路,导致数据包无限循环和广播风暴。STP通过创建一个无环路的树形拓扑结构来避免这些问题。
-
配置STP主要包括以下几个步骤:
-
启用STP:在交换机上启用STP功能,通常使用命令行界面设置,如Cisco的
spanning-tree enable
或华为的stp enable
。 -
配置优先级和根桥:确定网络中的根桥(Bridge ID最低),以便决定哪些端口将成为根端口和指定端口。默认情况下,优先级通常为32768,可以通过命令行修改。
-
配置端口角色:端口可能成为根端口、指定端口、备份端口或非转发端口。根据网络拓扑和需求选择合适的端口角色。
-
设置阻塞/监听模式:端口可以被配置为阻塞模式(默认),在此期间端口不会转发数据,学习完成后切换到转发模式;也可以配置为监听模式,只学习但不转发。
-
配置BPDU(Bridge Protocol Data Unit):STP通过发送BPDU消息来维护拓扑信息。配置BPDU的间隔时间、最大跳数等参数。
-
配置拓扑变化通知:可以配置交换机在拓扑变化时发送通知,以便管理员监控和处理。
-
任务 配置 STP
场景
您是公司的网络管理员,为了避免网络中的环路问题,需要在网络中的交换机上配置STP。本实验中,您还需要通过修改桥优先级来控制STP的根桥选举,并通过配置STP的一些特性来加快STP的收敛速度。
操作步骤
步骤一 配置 STP 并验证
为了保证实验结果的准确性,必须先关闭无关的端口。
配置STP之前,先关闭S1上的G0/0/1、G0/0/2、G0/0/3、G0/0/13、G0/0/14端口,S2的G0/0/1、G0/0/2、G0/0/3、G0/0/6、G0/0/7端口,S3上的G0/0/1、G0/0/7、
G0/0/13端口,S4上的G0/0/1、G0/0/6、G0/0/14端口。确保设备以空配置启动。如果STP被禁用,则执行stp enable命令启用STP。
<Quidway>system view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S1
[S1]interface GigabitEthernet 0/0/1
[S1 GigabitEthernet0/0/1]shutdown
[S1 GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet 0/0/2
[S1 GigabitEthernet0/0/2]shutdown
[S1 GigabitEthernet0/0/2]quit
[S1]interface GigabitEthernet 0/0/3[S1 GigabitEthernet0/0/3]shutdown[S1 GigabitEthernet0/0/3]quit[S1]interface GigabitEthernet 0/0/13[S1 GigabitEthernet0/0/13]shutdown[S1 GigabitEthernet0/0/13]quit[S1]interface GigabitEthernet 0/0/14[S1 GigabitEthernet0/0/14]shutdown[S1 GigabitEthernet0/0/14]quit
<Quidway>system view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S2
[S2]interface GigabitEthernet 0/0/1
[S2 GigabitEthernet0/0/1]shutdown
[S2 GigabitEthernet0/0/1]quit
[S2]interface GigabitEthernet 0/0/2
[S2 GigabitEthernet0/0/2]shutdown
[S2 GigabitEthernet0/0/2]quit
[S2]interface GigabitEthernet 0/0/3[S2 GigabitEthernet0/0/3]shutdown[S2 GigabitEthernet0/0/3]quit[S2]interface GigabitEthernet 0/0/6[S2 GigabitEthernet0/0/6]shutdown[S2 GigabitEthernet0/0/6]quit[S2]interface GigabitEthernet 0/0/7[S2 GigabitEthernet0/0/7]shutdown[S2 GigabitEthernet0/0/7]quit
<Quidway>system view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S3
[S3]interface GigabitEthernet 0/0/1
[S3 GigabitEthernet0/0/1]shutdown
[S3 GigabitEthernet0/0/1]quit
[S3]interface GigabitEthernet 0/0/13[S3 GigabitEthernet0/0/13]shutdown[S3 GigabitEthernet0/0/13]quit[S3]interface GigabitEthernet 0/0/7[S3 GigabitEthernet0/0/7]shutdown
<Quidway>system view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S4
[S4]inter GigabitEthernet 0/0/1
[S4 GigabitEthernet0/0/1]shutdown
[S4 GigabitEthernet0/0/1]quit
[S4]inter GigabitEthernet 0/0/14
[S4 GigabitEthernet0/0/14]shutdown
[S4 GigabitEthernet0/0/14]quit
[S4]interface GigabitEthernet 0/0/6[S4 GigabitEthernet0/0/6]shutdown
本实验中,S1和S2之间有两条链路。在S1和S2上启用STP,并把S1配置为根桥。
[S1]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]stp root primary
[S2]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]stp root secondary
执行display stp brief命令查看STP信息。
<S1>display stp briefMSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 DESI FORWARDING NONE 0 GigabitEthernet0/0/10 DESI FORWARDING NONE
<S2>display stp briefMSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE 0 GigabitEthernet0/0/10 ALTE DISCARDING NONE
执行display stp interface命令查看端口的STP状态。
<S1>display stp interface GigabitEthernet 0/0/10
[CIST Global Info][Mode STP]
CIST Bridge :0 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :0 .d0d0 4ba6 aab0 / 0 (This bridge is the root)CIST RegRoot/IRPC :0 .d0d0 4ba6 aab0 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledCIST Root Type :Primary rootTC or TCN received :11
TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 1h:43m:55sNumber of TC :29
Last TC occurred :GigabitEthernet0/0/9
[Port10(GigabitEthernet0/0/10)][FORWARDING]Port Protocol :Enabled
Port Role :Designated PortPort Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :0.d0d0 4ba6 aab0 / 128.10Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20TC or TCN send :52
TC or TCN received :0
BPDU Sent :3189
TCN: 0, Config: 3189, RST: 0, MST: 0BPDU Received :5
TCN: 0, Config: 5, RST: 0, MST: 0Last forwarding time: 2016/11/21 14:55:11 UTC
<S2>display stp interface GigabitEthernet 0/0/10
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :0 .d0d0 4ba6 aab0 / 20000CIST RegRoot/IRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)BPDU Protection :Disabled
CIST Root Type :Secondary rootTC or TCN received :122
TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 1h:50m:0sNumber of TC :17
Last TC occurred :GigabitEthernet0/0/9
[Port10(GigabitEthernet0/0/10)][DISCARDING]Port Protocol :Enabled
Port Role :Alternate PortPort Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :0.d0d0 4ba6 aab0 / 128.10Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0TC or TCN send :0
TC or TCN received :18
BPDU Sent :2 TCN: 0, Config: 2, RST: 0, MST: 0BPDU Received :3317 TCN: 0, Config: 3317, RST: 0, MST: 0
步骤二 控制根桥选举
执行display stp命令查看根桥信息。根桥设备的CIST Bridge与CIST Root/ERPC字段取值相同。
<S1>display stp
[CIST Global Info][Mode STP]
CIST Bridge :0 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :0 .d0d0 4ba6 aab0 / 0 (This bridge is the root)CIST RegRoot/IRPC :0 .d0d0 4ba6 aab0 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledCIST Root Type :Primary root
TC or TCN received :11TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 2h:32m:25s……output omit……
<S2>display stp
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :0 .d0d0 4ba6 aab0 / 20000CIST RegRoot/IRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)BPDU Protection :Disabled
CIST Root Type :Secondary rootTC or TCN received :122
TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 2h:35m:57s……output omit……
通过配置优先级,使S2为根桥,S1为备份根桥。桥优先级取值越小,则优先级越高。把
S1和S2的优先级分别设置为8192和4096。[S1]undo stp root[S1]stp priority 8192
[S2]undo stp root
[S2]stp priority 4096
执行display stp命令查看新的根桥信息。
<S1>display stp
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 20000CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)BPDU Protection :Disabled
TC or TCN received :47TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:6m:55s……output omit……
<S2>display stp
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 0 (This bridge is the root)CIST RegRoot/IRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledTC or TCN received :135TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:8m:4s……output omit……
由上述回显信息中的灰色部分可以看出,S2已经变成新的根桥。
关闭S2的G0/0/9和G0/0/10端口,从而隔离S1与S2,模拟S2发生故障。[S2]interface GigabitEthernet 0/0/9[S2 GigabitEthernet0/0/9]shutdown[S2 GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2 GigabitEthernet0/0/10]shutdown
<S1>display stp
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :8192 .d0d0 4ba6 aab0 / 0 (This bridge is the root)CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledTC or TCN received :174TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:12m:51s……output omit……
在上述回显信息中,灰色部分表明当S2故障时,S1变成根桥,然后开启S2之前关闭的接口。
[S2]interface GigabitEthernet 0/0/9
[S2 GigabitEthernet0/0/9]undo shutdown
[S2 GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2 GigabitEthernet0/0/10]undo shutdown
<S1>display stp
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 20000CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0
CIST RootPortId :128.34 (GigabitEthernet0/0/9)
BPDU Protection :DisabledTC or TCN received :195TC count per hello :1
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:2m:59s……output omit……
<S2>display stp
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 0 (This bridge is the root)CIST RegRoot/IRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledTC or TCN received :146TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:2m:20s……output omit……
在上述回显信息中,灰色部分表明S2已经恢复正常,重新变成根桥。
步骤三 控制根端口选举
在S1上执行display stp brief命令查看端口角色。
<S1>display stp brief
MSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDINGNONE0 GigabitEthernet0/0/10 ALTE DISCARDING NONE
上述回显信息表明G0/0/9是根端口,G0/0/10是Alternate端口。通过修改端口优先级,使G0/0/10成为根端口,G0/0/9成为Alternate端口。
修改S2上G0/0/9和G0/0/10端口的优先级。
缺省情况下端口优先级为128。端口优先级取值越大,则优先级越低。在S2上,修改
G0/0/9的端口优先级值为32,G0/0/10的端口优先级值为16。因此,S1上的G0/0/10端口优先级值大于S2的G0/0/10端口优先级,成为根端口。[S2]interface GigabitEthernet 0/0/9
[S2 GigabitEthernet0/0/9]stp port priority 32
[S2 GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2 GigabitEthernet0/0/10]stp port priority 16
提示:此处是修改S2的端口优先级,而不是修改S1的端口优先级。<S2>display stp interface GigabitEthernet 0/0/9
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 0 (This bridge is the root)CIST RegRoot/IRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledTC or TCN received :147TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:7m:35sNumber of TC :41
Last TC occurred :GigabitEthernet0/0/10
[Port34(GigabitEthernet0/0/9)][FORWARDING]Port Protocol :Enabled
Port Role :Designated PortPort Priority :32
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :4096.d0d0 4ba6 ac20 / 32.34Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s
Protection Type :None Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20TC or TCN send :35
TC or TCN received :2
BPDU Sent :1013 TCN: 0, Config: 1013, RST: 0, MST: 0BPDU Received :2 TCN: 2, Config: 0, RST: 0, MST: 0
Last forwarding time: 2016/11/22 10:00:00 UTC
<S2>display stp interface GigabitEthernet 0/0/10
[CIST Global Info][Mode STP]CIST Bridge :4096 .d0d0 4ba6 ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 0 (This bridge is the root)CIST RegRootIRPC :4096 .d0d0 4ba6 ac20 / 0
CIST RootPortId :0.0
BPDU Protection :DisabledTC or TCN received :147TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:8m:19sNumber of TC :41
Last TC occurred :GigabitEthernet0/0/10
[Port35(GigabitEthernet0/0/10)][FORWARDING]Port Protocol :Enabled
Port Role :Designated PortPort Priority :16
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :4096.d0d0 4ba6 ac20 / 16.35Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s
Protection Type :None Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20TC or TCN send :35
TC or TCN received :1
BPDU Sent :1032 TCN: 0, Config: 1032, RST: 0, MST: 0BPDU Received :2 TCN: 1, Config: 1, RST: 0, MST: 0Last forwarding time: 2016/11/22 10:00:11 UTC
在S1上执行display stp brief命令查看端口角色。
<S1>display stp brief
MSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
在上述回显信息中,灰色部分表明S1的G0/0/10端口是根端口,G0/0/9是Alternate端口。
关闭S1的GigabitEthernet 0/0/10端口,再查看端口角色。
[S1]interface GigabitEthernet 0/0/10[S1 GigabitEthernet0/0/10]shutdown<S1>display stp brief
MSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
在上述回显信息中的灰色部分可以看出,S1的G0/0/9变成了根端口。在S2上恢复G0/0/9和G0/0/10端口的缺省优先级,并重新开启S1上关闭的端口。[S2]interface GigabitEthernet 0/0/9
[S2 GigabitEthernet0/0/9]undo stp port priority
[S2 GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2 GigabitEthernet0/0/10]undo stp port priority
[S1]interface GigabitEthernet 0/0/10
[S1 GigabitEthernet0/0/10]undo shutdown
在S1上执行display stp brief命令和display stp interface命令查看端口角色。
<S1>display stp brief
MSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE
<S1>display stp interface GigabitEthernet 0/0/9
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 20000CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0
CIST RootPortId :128.34 (GigabitEthernet0/0/9)BPDU Protection :Disabled
TC or TCN received :314TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:0m:37sNumber of TC :61
Last TC occurred :GigabitEthernet0/0/9
[Port34(GigabitEthernet0/0/9)][FORWARDING]Port Protocol :Enabled
Port Role :Root PortPort Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :4096.d0d0 4ba6 ac20 / 128.34Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s
Protection Type :None Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0TC or TCN send :37
TC or TCN received :70
BPDU Sent :122 TCN: 3, Config: 119, RST: 0, MST: 0
BPDU Received :1259 TCN: 0, Config: 1259, RST: 0, MST: 0Last forwarding time: 2016/11/22 10:07:20 UTC
<S1>display stp interface GigabitEthernet 0/0/10
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 20000CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0
CIST RootPortId :128.34 (GigabitEthernet0/0/9)BPDU Protection :Disabled
TC or TCN received :314TC count per hello :0
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:6m:25sNumber of TC :61
Last TC occurred :GigabitEthernet0/0/9
[Port35(GigabitEthernet0/0/10)][DISCARDING]Port Protocol :Enabled
Port Role :Alternate PortPort Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000Designated Bridge/Port :4096.d0d0 4ba6 ac20 / 128.35Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s
Protection Type :None Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0TC or TCN send :0
TC or TCN received :17
BPDU Sent :2 TCN: 0, Config: 2, RST: 0, MST: 0BPDU Received :209 TCN: 0, Config: 209, RST: 0, MST: 0
在上述回显信息中,灰色部分表明G0/0/9和G0/0/10的端口开销缺省情况下为20000。修改S1上的G0/0/9端口开销值为200000。
[S1]interface GigabitEthernet 0/0/9
[S1 GigabitEthernet0/0/9]stp cost 200000
在S1上执行display stp brief命令和display stp interface命令查看端口角色。
<S1>display stp interface GigabitEthernet 0/0/9
[CIST Global Info][Mode STP]
CIST Bridge :8192 .d0d0 4ba6 aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0 4ba6 ac20 / 20000CIST RegRoot/IRPC :8192 .d0d0 4ba6 aab0 / 0CIST RootPortId :128.35 (GigabitEthernet0/0/10)BPDU Protection :Disabled
TC or TCN received :332TC count per hello :1
STP Converge Mode :Normal Share region configuration :EnabledTime since last TC :0 days 0h:9m:42sNumber of TC :61
Last TC occurred :GigabitEthernet0/0/9
[Port34(GigabitEthernet0/0/9)][DISCARDING]Port Protocol :Enabled
Port Role :Alternate PortPort Priority :128
Port Cost(Dot1T ) :Config=200000 / Active=200000Designated Bridge/Port :4096.d0d0 4ba6 ac20 / 128.34Port Edged :Config=default / Active=disabledPoint to point :Config=auto / Active=trueTransit Limit :6 packets/s
Protection Type :None Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1sBPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0TC or TCN send :37
TC or TCN received :80
BPDU Sent :122 TCN: 3, Config: 119, RST: 0, MST: 0BPDU Received :1531 TCN: 0, Config: 1531, RST: 0, MST: 0Last forwarding time: 2016/11/22 10:07:20 UTC
<S1>display stp brief
MSTID Port
Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
此时,S1上的G0/0/10端口变为根端口。
配置文件
<S1>display current configuration
#
!Software Version V200R008C00SPC500sysname S1
#
stp mode stp
stp instance 0 priority 8192
#
interface GigabitEthernet0/0/1shutdown
#
interface GigabitEthernet0/0/2shutdown
#
interface GigabitEthernet0/0/3shutdown
#
interface GigabitEthernet0/0/9stp instance 0 cost 200000
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/13 shutdown
#
interface GigabitEthernet0/0/14shutdown
# user interface con 0user interface vty 0 4
#
return
<S2>display current configuration
#
!Software Version V200R008C00SPC500sysname S2
#
stp mode stp
stp instance 0 priority 4096
#
interface GigabitEthernet0/0/1shutdown
#
interface GigabitEthernet0/0/2shutdown
#
interface GigabitEthernet0/0/3shutdown
#
interface GigabitEthernet0/0/6shutdown
#
interface GigabitEthernet0/0/7shutdown
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
user interface con 0 user interface vty 0 4
#
return
<S3>display current configuration
#
!Software Version V200R008C00SPC500sysname S3
#
interface GigabitEthernet0/0/1shutdown
#
interface GigabitEthernet0/0/7shutdown
#
interface GigabitEthernet0/0/13shutdown
#
user interface con 0
user interface vty 0 4
#
return
<S4>display current configuration
#
!Software Version V200R008C00SPC500sysname S4
#
interface GigabitEthernet0/0/14shutdown
#
interface GigabitEthernet0/0/1shutdown
#
interface GigabitEthernet0/0/6shutdown
#
user interface con 0
user interface vty 0 4
#
return