Enable Spanning Tree on a VLAN

The spanning tree bridge and port parameters are configurable using one CLI command set at the global configuration level of each Port-based VLAN. Suppose you want to enable the IEEE 802.1W RSTP across VLAN 3. To do so, use the following method.

Note: When port-based VLANs are not operating on the system, STP is set on a system-wide level at the global CONFIG level of the CLI.
  1. Access the global configuration level of the CLI on Device-A by entering the following commands.
    device-A> enable
    No password has been assigned yet...
    device-A# configure terminal
    device-A(config)# 
    
  2. Access the level of the CLI for configuring port-based VLAN 3 by entering the following command.
    device-A(config)# 
    device-A(config)# vlan 3
    device-A(config-vlan-3)# 
    
  3. From VLAN 3 configuration level of the CLI, enter the following command to enable STP on all tagged and untagged ports associated with VLAN 3.
    device-A(config-vlan-3)# 
    device-A(config-vlan-3)# spanning-tree 802-1w
    device-A(config-vlan-3)# 
    
  4. Enter the following commands to exit the VLAN configuration mode and save the configuration to the system-config file on flash memory.
    device-A(config-vlan-3)# 
    device-A(config-vlan-3)# end
    device-A# write memory
    device-A# 
    
  5. Repeat steps 1 - 4 on Device-B.
    Note: You do not need to configure values for the RSTP parameters. All parameters have default values as noted below. Additionally, all values will be globally applied to all ports on the system or on the port-based VLAN for which they are defined.

To configure RSTP bridge and port parameters, refer to Configuring IEEE 802.1w Rapid Spanning Tree Protocol.