LS-NET-004-简单二层环路解决(华为锐捷思科)

79 阅读1分钟

LS-NET-004-简单二层环路解决(华为锐捷思科)

以下是为您准备的二层环路示意图及解决方案,包含四大厂商配置对比:

一、Mermaid 二层环路示意图

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

二、环路导致的问题

  1. 广播风暴:ARP请求等广播帧无限循环
  2. MAC地址表震荡:交换机频繁更新MAC-Port映射
  3. CPU过载:设备处理大量重复数据包
  4. 网络瘫痪:正常流量无法传输

三、解决方案(STP协议)

通用原理
graph LR
    STP[生成树协议] --> RootBridge[选举根桥]
    STP --> BlockPort[阻塞冗余端口]
    STP --> BPDU[发送BPDU报文]
    BlockPort --> 消除环路

四、四大厂商配置对比

功能思科华为华三锐捷
启用STPspanning-tree vlan 1stp enablestp enablespanning-tree
设置优先级spanning-tree vlan 1 priority 4096stp priority 4096stp priority 4096spanning-tree priority 4096
查看STP状态show spanning-treedisplay stpdisplay stpshow spanning-tree
快速收敛配置spanning-tree mode rapid-pvststp mode rstpstp mode rstpspanning-tree mode rstp
BPDU保护spanning-tree portfast bpduguard defaultstp bpdu-protectionstp bpdu-protectionspanning-tree portfast bpdu-guard

五、推荐配置示例(以VLAN 10为例)

思科设备

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

六、进阶防护方案

  1. 环路检测增强

    • 思科:loopguard default
    • 华为:loop-detection enable
  2. 拓扑变更保护

    • 华三:stp tc-protection
    • 锐捷:spanning-tree tc-protection