spanning-tree mode [rapid-pvst|mst]
Configures the Spanning Tree Protocol (STP) mode to either Rapid PVST+ or MST on a Cisco Nexus switch.
Overview
The 'spanning-tree mode' command is used to select the Spanning Tree Protocol (STP) variant on Cisco Nexus switches. STP is a Layer 2 protocol that prevents loops in Ethernet networks by creating a loop-free logical topology. Cisco NX-OS supports two modes: Rapid PVST+ (Per-VLAN Spanning Tree Plus) and MST (Multiple Spanning Tree). Rapid PVST+ runs a separate instance of Rapid Spanning Tree Protocol (RSTP) for each VLAN, providing fast convergence (typically 1-2 seconds) and per-VLAN load balancing. It is the default mode on Nexus switches and is suitable for networks with a moderate number of VLANs. MST, based on IEEE 802.1s, allows mapping multiple VLANs to a single spanning-tree instance, reducing CPU and bandwidth overhead in large networks with many VLANs. MST requires configuration of a region (name, revision number, and VLAN-to-instance mapping) that must be consistent across all switches in the region. The choice between Rapid PVST+ and MST depends on network size, scalability requirements, and interoperability with other vendors. In troubleshooting workflows, verifying the STP mode is a first step when diagnosing STP-related issues like loops or convergence problems. On Nexus, the command is applied globally and takes effect immediately, but a topology change may occur. Always ensure that all switches in the Layer 2 domain use the same STP mode to avoid incompatibility.
spanning-tree mode {rapid-pvst | mst}When to Use This Command
- Enabling Rapid PVST+ for fast convergence in a VLAN-based STP topology.
- Configuring MST to reduce STP instances in a large Layer 2 network with many VLANs.
- Migrating from PVST+ to Rapid PVST+ to improve convergence time.
- Setting MST to map multiple VLANs to a single spanning-tree instance for scalability.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| rapid-pvst | rapid-pvst | Selects Rapid Per-VLAN Spanning Tree Plus mode. This is the default on Nexus switches. It runs RSTP per VLAN, providing fast convergence and per-VLAN load balancing. |
| mst | mst | Selects Multiple Spanning Tree mode (IEEE 802.1s). Allows mapping multiple VLANs to a single spanning-tree instance. Requires additional MST region configuration. |
Command Examples
Enable Rapid PVST+ mode
spanning-tree mode rapid-pvstThis command sets the STP mode to Rapid PVST+. No output is displayed if successful. Use 'show spanning-tree' to verify.
Enable MST mode
spanning-tree mode mstThis command sets the STP mode to MST. After this, you must configure MST region parameters (name, revision, VLAN-to-instance mapping).
Understanding the Output
The 'spanning-tree mode' command does not produce output on its own. To verify the current STP mode, use 'show spanning-tree' or 'show running-config | include spanning-tree'. In the output of 'show spanning-tree', the first line indicates the mode, e.g., 'Spanning tree enabled protocol rstp' for Rapid PVST+ or 'Spanning tree enabled protocol mst' for MST. For MST, additional details like region name, revision, and instance mappings appear. A healthy state shows all ports in forwarding/blocking as expected; problem states include inconsistent port roles or BPDU guard violations.
Configuration Scenarios
Configuring Rapid PVST+ on a Nexus Switch
A small data center with 50 VLANs. Need fast convergence and per-VLAN load balancing.
Topology
Nexus-1 --- Nexus-2
| |
+--- Access SwitchesSteps
- 1.Enter global configuration mode.
- 2.Set STP mode to rapid-pvst.
- 3.Optionally configure STP priorities per VLAN for load balancing.
! Enter global config configure terminal ! Set STP mode spanning-tree mode rapid-pvst ! Optional: set root bridge for VLAN 10 spanning-tree vlan 10 root primary
Verify: Use 'show spanning-tree' to verify mode and root bridge status.
Watch out: Rapid PVST+ is default; if already set, no change occurs. Ensure all switches in the network use the same mode.
Configuring MST on a Nexus Switch
A large campus network with 500 VLANs. Need to reduce STP instances.
Topology
Nexus-Core --- Nexus-Dist-1 --- Access
|
Nexus-Dist-2Steps
- 1.Enter global configuration mode.
- 2.Set STP mode to mst.
- 3.Enter MST configuration submode.
- 4.Set region name and revision number.
- 5.Map VLANs to instances.
- 6.Exit and apply.
! Enter global config configure terminal ! Set STP mode to MST spanning-tree mode mst ! Enter MST configuration spanning-tree mst configuration ! Set region name name CAMPUS ! Set revision revision 1 ! Map VLANs 1-100 to instance 1 instance 1 vlan 1-100 ! Map VLANs 101-200 to instance 2 instance 2 vlan 101-200 ! Exit end
Verify: Use 'show spanning-tree mst configuration' to verify region settings and 'show spanning-tree mst instance 1' to see instance details.
Watch out: MST region parameters must match exactly on all switches in the region; otherwise, they will be considered separate regions.
Troubleshooting with This Command
When troubleshooting STP issues on Cisco Nexus, the 'spanning-tree mode' command is a starting point to confirm the STP variant in use. Use 'show spanning-tree' to display the current mode and overall STP state. For Rapid PVST+, check per-VLAN root bridge and port roles. For MST, verify region consistency with 'show spanning-tree mst configuration'. Common issues include: (1) Inconsistent STP mode across switches – ensure all switches in the Layer 2 domain use the same mode. (2) MST region mismatch – verify region name, revision, and VLAN mapping match on all switches. (3) Unexpected root bridge election – check bridge priorities. (4) Port role inconsistencies – look for ports in 'alternate' or 'backup' roles that should be 'blocking'. Use 'show spanning-tree vlan <vlan>' for Rapid PVST+ or 'show spanning-tree mst instance <instance>' for MST to drill down. If BPDU guard or root guard is enabled, check for err-disabled ports. For convergence issues, verify that all links are operating in full duplex and that STP timers are not misconfigured. On Nexus, the default STP mode is Rapid PVST+, which provides fast convergence; if MST is used, ensure that the network is designed with MST regions properly. Use 'debug spanning-tree' cautiously in a lab to trace BPDU exchanges. Always check the system logs for STP-related messages.
CCNA Exam Tips
CCNP SWITCH: Know that Rapid PVST+ is the default on Nexus switches and provides faster convergence than PVST+.
CCNP SWITCH: Understand that MST requires consistent region configuration across all switches in the MST region.
CCNP SWITCH: Remember that changing STP mode can cause a temporary topology change; plan maintenance windows.
Common Mistakes
Mistake: Forgetting to configure MST region parameters after switching to MST mode. Consequence: MST defaults to the CIST (Common and Internal Spanning Tree) with no VLAN mapping, causing all VLANs to map to instance 0.
Mistake: Using 'spanning-tree mode pvst' (PVST+) on Nexus; Nexus only supports rapid-pvst and mst. Consequence: Command rejected.
Mistake: Changing STP mode without verifying compatibility with neighboring switches. Consequence: STP incompatibility may cause loops or loss of connectivity.
Platform Notes
On Cisco NX-OS (Nexus), the 'spanning-tree mode' command differs from Cisco IOS in that Nexus only supports rapid-pvst and mst; it does not support legacy PVST+ or classic STP. The default mode is rapid-pvst. In contrast, Cisco IOS defaults to PVST+ (or rapid-pvst on some platforms). When migrating from IOS to NX-OS, note that the command syntax is identical but the available modes are limited. For MST configuration, the submode 'spanning-tree mst configuration' is similar to IOS, but Nexus requires explicit 'name' and 'revision' commands. On Nexus, the 'spanning-tree mode' command is applied globally and takes effect immediately; there is no need to reload. For verification, 'show spanning-tree' output includes the mode in the first line. On other platforms like Arista, the equivalent command is 'spanning-tree mode' with options 'rapid-pvst' or 'mst', but Arista also supports 'rstp' as a mode. On Juniper, STP is configured under 'protocols stp' with 'bridge-mode' for RSTP or 'vlan' for VLAN-based. Understanding these differences is crucial for multi-vendor environments.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions