spanning-tree vlan

To configure Spanning Tree Protocol (STP) parameters on a per-VLAN basis, use the spanning-tree vlan command. To return to the default settings, use the no form of this command.

spanning-tree vlan vlan-id [forward-time value | hello-time value | max-age value | priority value | [root {primary | secondary} [diameter dia [hello-time value]]]]

no spanning-tree vlan vlan-id [forward-time | hello-time | max-age | priority | root]

Syntax Description

vlan-id

VLAN identification number. The VLAN ID range is from 0 to 4094.

forward-time value

(Optional) Specifies the STP forward-delay time. The range is from 4 to 30 seconds.

hello-time value

(Optional) Specifies the number of seconds between the generation of configuration messages by the root switch. The range is from 1 to 10 seconds.

max-age value

(Optional) Specifies the maximum number of seconds that the information in a bridge protocol data unit (BPDU) is valid. The range is from 6 to 40 seconds.

priority value

(Optional) Specifies the STP-bridge priority; the valid values are 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440. All other values are rejected.

root primary

(Optional) Forces this switch to be the root bridge.

root secondary

(Optional) Forces this switch to be the root switch if the primary root fails.

diameter dia

(Optional) Specifies the maximum number of bridges between any two points of attachment between end stations.


Command Default

The defaults are as follows:

•forward-time—15 seconds

•hello-time—2 seconds

•max-age—20 seconds

•priority—32768

Command Modes

Global configuration mode

Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.


Usage Guidelines


Caution When disabling spanning tree on a VLAN using the no spanning-tree vlan vlan-id command, ensure that all switches and bridges in the VLAN have spanning tree disabled. You cannot disable spanning tree on some switches and bridges in a VLAN and leave it enabled on other switches and bridges in the same VLAN because switches and bridges with spanning tree enabled have incomplete information about the physical topology of the network.


Caution We do not recommend disabling spanning tree even in a topology that is free of physical loops. Spanning tree is a safeguard against misconfigurations and cabling errors. Do not disable spanning tree in a VLAN without ensuring that there are no physical loops present in the VLAN.

When setting the max-age seconds, if a bridge does not see BPDUs from the root bridge within the specified interval, it assumes that the network has changed and recomputes the spanning-tree topology.

The spanning-tree root primary alters this switch's bridge priority to 24576. If you enter the spanning-tree root primary command and the switch does not become the root, then the bridge priority is changed to 4096 less than the bridge priority of the current bridge. The command fails if the value required to be the root bridge is less than 1. If the switch does not become the root, an error results.

If the network devices are set for the default bridge priority of 32768 and you enter the spanning-tree root secondary command, the software alters this switch's bridge priority to 28762. If the root switch fails, this switch becomes the next root switch.

Use the spanning-tree root commands on the backbone switches only.

Examples

This example shows how to enable spanning tree on VLAN 200:

switch(config)# spanning-tree vlan 200  

This example shows how to configure the switch as the root switch for VLAN 10 with a network diameter of 4:

switch(config)# spanning-tree vlan 10 root primary diameter 4  

This example shows how to configure the switch as the secondary root switch for VLAN 10 with a network diameter of 4:

switch(config)# spanning-tree vlan 10 root secondary diameter 4  

Related Commands

Command
Description

show spanning-tree

Displays information about the spanning tree state.