首页/网络/网络设备配置速查/聚合与 STP 的交互(生成树视角)
本包目录(508 条)
设备开局与基础配置61 条
接口与链路73 条
VLAN 与二层交换60 条路由(静态 / OSPF)62 条ACL 与安全65 条NAT 与出口31 条DHCP 与地址服务32 条堆叠、高可用与备份升级52 条设备排障72 条

聚合与 STP 的交互(生成树视角)

聚合口在 STP 世界中是一条逻辑链路:边会收敛、代价按聚合带宽计算;STP 调优要作用在聚合口上,成员口不参与独立的 STP 决策。

网络设备配置速查网络更新于 2026-10-12
场景双上联拓扑、STP 收敛调优
适用二层聚合 + STP 环境
命令族stp cost(聚合口)/ spanning-tree cost(port-channel)/ stp cost(聚合口)

华为 VRP

华为 VRP
[Huawei-Eth-Trunk1] stp cost 2000       ! 在聚合口上调整路径开销
<Huawei> display stp brief | include Eth-Trunk
[Huawei-Eth-Trunk1] stp edged-port        ! 边缘端口按需(面向服务器)

思科 IOS

思科 IOS
SW-A(config)# interface port-channel 1
SW-A(config-if)# spanning-tree cost 2000
SW-A# show spanning-tree interface port-channel 1
! 成员口不单独参与 STP 计算

H3C Comware

H3C Comware
[H3C-Bridge-Aggregation1] stp cost 2000
<H3C> display stp brief
! 边缘端口:stp edged-port(面向服务器/终端)
要点:① 成员口状态变化不必然引起 STP 收敛(除非全部成员失效)② 聚合口 stp cost 影响选路对比 ③ 双上联场景一般让聚合口承担转发、备用链路阻塞。

易错点

  • 在成员口上做 STP 调优不生效(计算单位是聚合口),白忙一场
  • 聚合口误配边缘端口(edged-port)遇 BPDU 会触发保护,服务器侧聚合要确认模式

数据来源与参考

  • 华为 MSTP 与聚合
  • Cisco STP 与 EtherChannel
  • H3C STP 与聚合交互

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌