Command:

spanning-tree vlan


Mode:

Switch(config)#


Syntax:

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

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

 

Syntax Description:

vlan-id VLAN range associated with a spanning-tree instance. You can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094 when the enhanced software image (EI) is installed and 1 to 1005 when the standard software image (SI) is installed.
forward-time seconds Set the forward-delay time for the specified spanning-tree instance. The forwarding time determines how long each of the listening and learning states last before the interface begins forwarding. The range is 4 to 30 seconds.
hello-time seconds Set the interval between hello bridge protocol data units (BPDUs) sent by the root switch configuration messages. The range is 1 to 10 seconds.
max-age seconds Set the interval between messages the spanning tree receives from the root switch. If a switch does not receive a BPDU message from the root switch within this interval, it recomputes the spanning-tree topology. The range is 6 to 40 seconds.
priority priority Set the switch priority for the specified spanning-tree instance. This setting affects the likelihood that the switch is selected as the root switch. A lower value increases the probability that the switch is selected as the root switch. The range is 0 to 61440 in increments of 4096. Valid priority values are 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, and 61440. All other values are rejected.
root primary Force this switch to be the root switch.
root secondary Set this switch to be the root switch should the primary root switch fail.
diameter net-diameter Set the maximum number of switches between any two end stations. The range is 2 to 7.

 

Command Description:

Use the spanning-tree vlan global configuration command to configure spanning tree on a per-VLAN basis. Use the no form of this command to return to the default setting.

Disabling the STP causes the VLAN to stop participating in the spanning-tree topology. Interfaces that are administratively down remain down. Received BPDUs are forwarded like other multicast frames. The switch does not detect and prevent loops in a VLAN if STP is disabled for that VLAN.

You can disable the STP on a VLAN that is not currently active and verify the change by using the show running-config or the show spanning-tree vlan vlan-id privileged EXEC command. The setting takes effect when the VLAN is activated.

When disabling or re-enabling the STP, you can specify a range of VLANs that you want to disable or enable.

When the STP is disabled and then enabled, all assigned VLANs continue to be its members. However, all spanning-tree bridge parameters are returned to their previous settings (the last setting before the VLAN was disabled).

You can enable spanning-tree options on a VLAN that has no interfaces assigned to it. The setting takes effect when you assign interfaces to it.

When setting the max-age seconds, if a switch does not receive BPDUs from the root switch within the specified interval, it recomputes the spanning-tree topology. The max-age setting must be greater than the hello-time setting.

The spanning-tree vlan vlan-id root command should be used only on backbone switches.

When you enter the spanning-tree vlan vlan-id root command, the software checks the switch priority of the current root switch for each VLAN. Because of the extended system ID support, the switch sets the switch priority for the specified VLAN to 24576 if this value will cause this switch to become the root for the specified VLAN. If any root switch for the specified VLAN has a switch priority lower than 24576, the switch sets its own priority for the specified VLAN to 4096 less than the lowest switch priority. (4096 is the value of the least-significant bit of a 4-bit switch priority value.)

When you enter the spanning-tree vlan vlan-id root primary command, the switch recalculates the forward-time, hello-time, max-age, and priority settings. If you previously configured these parameters, the switch overrides and recalculates them.

When you enter the spanning-tree vlan vlan-id root secondary command, because of support for the extended system ID, the software changes the switch priority from the default value (32768) to 28672. If the root switch should fail, this switch becomes the next root switch (if the other switches in the network use the default switch priority of 32768, and therefore, are unlikely to become the root switch).


Example:

This example shows how to disable the STP on VLAN 5:

Switch(config)#no spanning-tree vlan 5
You can verify your setting by entering the show spanning-tree privileged EXEC command. In this instance, VLAN 5 does not appear in the list.

This example shows how to set the spanning-tree forwarding time to 18 seconds for VLANs 20 and 25:

Switch(config)#spanning-tree vlan 20,25 forward-time 18
This example shows how to set the spanning-tree hello-delay time to 3 seconds for VLANs 20 to 24:

Switch(config)#spanning-tree vlan 20-24 hello-time 3
This example shows how to set spanning-tree max-age to 30 seconds for VLAN 20:

Switch(config)#spanning-tree vlan 20 max-age 30
This example shows how to reset the max-age parameter to the default value for spanning-tree instances 100 and 105 to 108 :

Switch(config)#no spanning-tree vlan 100,105-108 max-age
This example shows how to set the spanning-tree priority to 8192 for VLAN 20:

Switch(config)#spanning-tree vlan 20 priority 8192
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
You can verify your settings by entering the show spanning-tree vlan vlan-id privileged EXEC command.


Misconceptions:

None.


Related Commands:

spanning-tree cost
spanning-tree portfast
spanning-tree uplinkfast


© Cisco Systems, Inc. 2001, 2002
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)