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.1D STP 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 CONFIG 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
  2. Access the level of the CLI for configuring port-based VLAN 3 by entering the following command.
    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-B(config-vlan-3)# spanning-tree
  4. Enter the following commands to exit the VLAN CONFIG mode and save the configuration to the system-config file on flash memory.
    device-B(config-vlan-3)# end
    device-B# write memory
  5. Repeat steps 1 - 4 on Device-B.
    Note: You do not need to configure values for the STP 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 a specific path-cost or priority value for a given port, enter those values using the key words in the brackets [ ] shown in the syntax summary below. If you do not want to specify values for any given port, this portion of the command is not required.

Bridge STP parameters (applied to all ports within a VLAN):
  • Forward Delay - the period of time a bridge will wait (the listen and learn period) before forwarding data packets. Possible values: 4 - 30 seconds. Default is 15.
  • Maximum Age - the interval a bridge will wait for receipt of a hello packet before initiating a topology change. Possible values: 6 - 40 seconds. Default is 20.
  • Hello Time - the interval of time between each configuration BPDU sent by the root bridge. Possible values: 1 - 10 seconds. Default is 2.
  • Priority - a parameter used to identify the root bridge in a network. The bridge with the lowest value has the highest priority and is the root. Possible values: 1 - 65,535. Default is 32,678.
Port parameters (applied to a specified port within a VLAN):
  • Path Cost - a parameter used to assign a higher or lower path cost to a port. Possible values: 1 - 65535. Default is (1000/Port Speed) for Half-Duplex ports and is (1000/Port Speed)/2 for Full-Duplex ports.
  • Priority - value determines when a port will be rerouted in relation to other ports. Possible values: 0 - 255. Default is 128.