以下是为您准备的二层环路示意图及解决方案,包含四大厂商配置对比:
graph TD SW1 -->|Gi0/1| SW2 SW2 -->|Gi0/2| SW3 SW3 -->|Gi0/3| SW1 SW1 -->|Gi0/4| PC1 SW2 -->|Gi0/5| PC2 SW3 -->|Gi0/6| PC3
graph LR STP[生成树协议] --> RootBridge[选举根桥] STP --> BlockPort[阻塞冗余端口] STP --> BPDU[发送BPDU报文] BlockPort --> 消除环路
功能 | 思科 | 华为 | 华三 | 锐捷 |
---|---|---|---|---|
启用STP | spanning-tree vlan 1 | stp enable | stp enable | spanning-tree |
设置优先级 | spanning-tree vlan 1 priority 4096 | stp priority 4096 | stp priority 4096 | spanning-tree priority 4096 |
查看STP状态 | show spanning-tree | display stp | display stp | show spanning-tree |
快速收敛配置 | spanning-tree mode rapid-pvst | stp mode rstp | stp mode rstp | spanning-tree mode rstp |
BPDU保护 | spanning-tree portfast bpduguard default | stp bpdu-protection | stp bpdu-protection | spanning-tree portfast bpdu-guard |
思科设备:
Switch(config)# spanning-tree mode rapid-pvst
Switch(config)# spanning-tree vlan 10 priority 4096
华为设备:
[Huawei] stp mode rstp
[Huawei] stp instance 0 priority 4096
华三设备:
[H3C] stp mode rstp
[H3C] stp instance 0 priority 4096
锐捷设备:
Ruijie(config)# spanning-tree mode rstp
Ruijie(config)# spanning-tree mst 0 priority 4096
loopguard default
loop-detection enable
stp tc-protection
spanning-tree tc-protection