How to Configure Spanning Tree (STP, RSTP, MSTP) on Huawei, Cisco, and Juniper

Huawei, Cisco, and Juniper are among the world’s leading networking vendors. Their switches and routers widely support STP (Spanning Tree Protocol), RSTP (Rapid Spanning Tree Protocol), and MSTP (Multiple Spanning Tree Protocol) to build stable and reliable network topologies.

configure spanning tree

This guide explains how to configure spanning tree on Huawei, Cisco, and Juniper devices, including configuration commands and topology structures.

For a full protocol overview and feature comparison, see our difference between stp rstp and mstp.

Configure Spanning Tree on Cisco Devices

Cisco switches support STP, RSTP, and MSTP through CLI commands.

STP Configuration on Cisco Switches

Switch(config)# spanning-tree mode stp
Switch(config)# spanning-tree vlan <vlan-id> root primary

Topology: STP topology is defined by the root bridge and blocking redundant links.

RSTP Configuration on Cisco Switches (Rapid-PVST+)

Switch(config)# spanning-tree mode rapid-pvst
Switch(config)# spanning-tree vlan <vlan-id> root primary

Topology: RSTP topology is the same as STP but allows much faster failover.

MSTP Configuration on Cisco Switches

Switch(config)# spanning-tree mode mst
Switch(config)# spanning-tree mst configuration
Switch(config-mst)# revision <revision-level>
Switch(config-mst)# instance <instance-id> vlan <vlan-id>
Switch(config-mst)# spanning-tree instance <instance-id> root primary

Topology: Cisco MSTP supports multiple spanning tree instances for VLAN load balancing.

Configure Spanning Tree on Huawei Devices

Huawei switches use STP, RSTP, and MSTP to implement spanning tree functionality.

STP Configuration on Huawei Switches

<Huawei> system-view
[Huawei] stp mode stp
[Huawei] stp enable

To optimize the topology, adjust the STP priority:

[Huawei] stp priority <priority>

Topology: Huawei STP topology is based on root bridge election and redundant link blocking.

RSTP Configuration on Huawei Switches

<Huawei> system-view
[Huawei] stp mode rstp
[Huawei] stp enable

To optimize the topology, adjust the RSTP priority:

[Huawei] stp priority <priority>

Topology: Huawei RSTP topology is similar to STP but provides faster convergence.

MSTP Configuration on Huawei Switches

<Huawei> system-view
[Huawei] stp mode mstp
[Huawei] stp region-configuration
[Huawei-mstp] revision-level <revision-level>
[Huawei-mstp] instance <instance-id> vlan <vlan-id>
[Huawei-mstp-instance] active
[Huawei-mstp-instance] exit
[Huawei] stp enable

Adjust MSTP priority:

[Huawei-mstp] instance <instance-id> priority <priority>

Topology: Huawei MSTP topology supports multiple VLAN-to-instance mappings.

Configure Spanning Tree on Juniper Devices

Juniper devices also implement STP, RSTP, and MSTP under the protocols hierarchy.

STP Configuration on Juniper Switches

[edit protocols]
user@juniper# set spanning-tree protocol-version stp

Topology: Juniper STP operates with standard root bridge and port blocking.

RSTP Configuration on Juniper Switches

[edit protocols]
user@juniper# set spanning-tree protocol-version rstp

Topology: Juniper RSTP provides faster convergence with the same tree structure.

MSTP Configuration on Juniper Switches

[edit protocols]
user@juniper# set spanning-tree protocol-version mstp
[edit protocols mstp]
user@juniper# set instance <instance-id> vlan <vlan-id>
user@juniper# set instance <instance-id> priority <priority>

Topology: Juniper MSTP allows mapping VLANs to different spanning tree instances.

Key Takeaways

  • Huawei: Configure spanning tree with stp mode stp/rstp/mstp, adjust priorities to optimize root bridge selection.
  • Cisco: Configure spanning tree with spanning-tree mode and set root priorities per VLAN.
  • Juniper: Configure spanning tree using spanning-tree protocol-version, define instances and priorities.

Conclusion

STP, RSTP, and MSTP are essential protocols for building stable and reliable Layer 2 topologies.

  • STP is the original protocol, suitable for small networks but slow to converge.
  • RSTP improves convergence speed, making it better for medium-sized networks.
  • MSTP extends functionality by supporting multiple VLANs and spanning tree instances, ideal for large-scale environments.

Choosing the right spanning tree protocol depends on network size and requirements. By properly configuring STP, RSTP, or MSTP on Huawei, Cisco, or Juniper devices, network engineers can achieve the right balance of stability, redundancy, and performance.

Similar Posts