Spanning Tree Commands

This chapter contains the following sections:

spanning-tree

Use the spanning-tree Global Configuration mode command to enable spanning-tree functionality. Use the no form of this command to disable the spanning-tree functionality.

Syntax

spanning-tree

no spanning-tree

Default Configuration

Spanning-tree is enabled.

Command Mode

Global Configuration mode

Example

The following example enables spanning-tree functionality.

switchxxxxxx(config)#  spanning-tree

spanning-tree mode

Use the spanning-tree mode Global Configuration mode command to select which Spanning Tree Protocol (STP) protocol to run. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree mode {stp| rstp | mst | pvst | rapid-pvst}

no spanning-tree mode

Parameters

  • stp—Specifies that STP is enabled.

  • rstp—Specifies that the Rapid STP is enabled.

  • mst—Specifies that the Multiple STP is enabled.

  • pvst—Specifies that the PVST+ is enabled.

  • rapid-pvst—Specifies that the Rapid PVST+ is enabled.

Default Configuration

The default is RSTP.

Command Mode

Global Configuration mode

User Guidelines

In the RSTP mode, the device uses STP on a port, when the neighbor device uses STP.

In the MSTP mode, the device uses RSTP when the neighbor device uses RSTP, and uses STP when the neighbor device uses STP.

If the PVST mode or the Rapid PVST mode is enabled the switch can support maximum 126 VLANs.

In the Rapid PVST mode, the device uses PVST into a VLAN on a port, when the neighbor device uses PVST.

Examples

The following example enables MSTP.

switchxxxxxx(config)#  spanning-tree mode mst

spanning-tree forward-time

Use the spanning-tree forward-time Global Configuration mode command to configure the spanning-tree bridge forward time, which is the amount of time a port remains in the listening and learning states before entering the forwarding state. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree forward-time seconds

no spanning-tree forward-time

Parameters

  • seconds—Specifies the spanning-tree forward time in seconds. (Range: 4–30)

Default Configuration

15 seconds.

Command Mode

Global Configuration mode

User Guidelines

When configuring the forwarding time, the following relationship should be maintained:

2*(Forward-Time - 1) >= Max-Age

Example

The following example configures the spanning tree bridge forwarding time to 25 seconds.

switchxxxxxx(config)#  spanning-tree forward-time 25

spanning-tree hello-time

Use the spanning-tree hello-time Global Configuration mode command to configure how often the device broadcasts Hello messages to other devices. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree hello-time seconds

no spanning-tree hello-time

Parameters

  • seconds—Specifies the spanning-tree Hello time in seconds. (Range: 1–10)

Default Configuration

2 seconds.

Command Mode

Global Configuration mode

User Guidelines

When configuring the Hello time, the following relationship should be maintained:

  • Max-Age >= 2*(Hello-Time + 1)

Example

The following example configures the spanning-tree bridge hello time to 5 seconds.

switchxxxxxx(config)#  spanning-tree hello-time 5

spanning-tree max-age

Use the spanning-tree max-age Global Configuration mode command to configure the STP maximum age. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree max-age seconds

no spanning-tree max-age

Parameters

  • seconds—Specifies the spanning-tree bridge maximum age in seconds. (Range: 6–40)

Default Configuration

The default maximum age is 20 seconds.

Command Mode

Global Configuration mode

User Guidelines

When configuring the maximum age, the following relationships should be maintained:

  • 2*(Forward-Time - 1) >= Max-Age

  • Max-Age >= 2*(Hello-Time + 1)

Example

The following example configures the spanning-tree bridge maximum age to 10 seconds.

switchxxxxxx(config)#  spanning-tree max-age 10

spanning-tree priority

Use the spanning-tree priority Global Configuration mode command to configure the device STP priority, which is used to determine which bridge is selected as the root bridge. Use the no form of this command to restore the default device spanning-tree priority.

Syntax

spanning-tree priority priority

no spanning-tree priority

Parameters

  • priority—Specifies the bridge priority. (Range: 0–61440)

Default Configuration

Default priority = 32768.

Command Mode

Global Configuration mode

User Guidelines

The priority value must be a multiple of 4096.

The switch with the lowest priority is the root of the spanning tree. When more than one switch has the lowest priority, the switch with the lowest MAC address is selected as the root.

Example

The following example configures the spanning-tree priority to 12288.

switchxxxxxx(config)#  spanning-tree priority 12288

spanning-tree disable

Use the spanning-tree disable Interface (Ethernet, Port Channel) Configuration mode command to disable the spanning tree on a specific port. Use the no form of this command to enable the spanning tree on a port.

Syntax

spanning-tree disable

no spanning-tree disable

Default Configuration

Spanning tree is enabled on all ports.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example disables the spanning tree on gi1/0/5

switchxxxxxx(config)#  interface gi1/0/5
switchxxxxxx(config-if)#  spanning-tree disable

spanning-tree cost

Use the spanning-tree cost Interface (Ethernet, Port Channel) Configuration mode command to configure the spanning-tree path cost for a port. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree cost cost

no spanning-tree cost

Parameters

  • cost—Specifies the port path cost. (Range: 1–200000000)

Default Configuration

Default path cost is determined by port speed and path cost method (long or short) as shown below.

Interface

Long

Short

Port-channel

Half the default cost based on Port-channel interface speed

Half the default cost based on Port-channel interface speed

TenGigabit Ethernet (10000 Mbps)

2000

2

5 Gigabit Ethernet (5000 Mbps)

12,000

3

2.5 Gigabit Ethernet (2500 Mbps)

17,000

4

Gigabit Ethernet (1000 Mbps)

20,000

4

Fast Ethernet (100 Mbps)

200,000

19

Ethernet (10 Mbps)

2,000,000

100

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example configures the spanning-tree cost on gi1/0/15 to 35000.

switchxxxxxx(config)#  interface gi1/0/15
switchxxxxxx(config-if)#  spanning-tree cost 35000

spanning-tree port-priority

Use the spanning-tree port-priority Interface (Ethernet, Port Channel) Configuration mode command to configure the port priority. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree port-priority priority

no spanning-tree port-priority

Parameters

  • priority—Specifies the port priority. (Range: 0–240)

Default Configuration

The default port priority is 128.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The priority value must be a multiple of 16.

Example

The following example configures the spanning priority on gi1/0/15 to 96

switchxxxxxx(config)#  interface gi1/0/15
switchxxxxxx(config-if)#  spanning-tree port-priority 96

spanning-tree portfast

Use the spanning-tree portfast Interface (Ethernet, Port Channel) Configuration mode command to enable the PortFast mode. Use the no form of this command to disable the PortFast mode.

Syntax

spanning-tree portfast [auto]

no spanning-tree portfast

Parameters

  • auto—Specifies delay before putting the interface into the PortFast mode.

Default Configuration

PortFast mode is set to auto.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

In the PortFast mode, the interface is immediately put into the forwarding state upon linkup, without waiting for the standard forward time delay.

Use the spanning-tree portfast command to enable immediately the PortFast mode.

Use the spanning-tree portfast auto to delay the PortFast mode for 3 seconds. The interface will turn into the PortFast mode if for this interval it does not receive a Spanning Tree protocol message.

Example

The following example enables the PortFast mode on gi1/0/15.

switchxxxxxx(config)#  interface gi1/0/15
switchxxxxxx(config-if)#  spanning-tree portfast

spanning-tree link-type

Use the spanning-tree link-type Interface (Ethernet, Port Channel) Configuration mode command to override the default link-type setting determined by the port duplex mode, and enable RSTP transitions to the Forwarding state. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree link-type {point-to-point | shared}

no spanning-tree spanning-tree link-type

Parameters

  • point-to-point—Specifies that the port link type is point-to-point.

  • shared—Specifies that the port link type is shared.

Default Configuration

The device derives the port link type from the duplex mode. A full-duplex port is considered a point-to-point link and a half-duplex port is considered a shared link.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example enables shared spanning-tree on gi1/0/15.

switchxxxxxx(config)#  interface gi1/0/15
switchxxxxxx(config-if)#  spanning-tree link-type shared

spanning-tree pathcost method

Use the spanning-tree pathcost method Global Configuration mode command to set the default path cost method. Use the no form of this command to return to the default configuration.

Syntax

spanning-tree pathcost method {long | short}

no spanning-tree pathcost method

Parameters

  • longSpecifies that the default port path costs are within the range: 1–200,000,000.

  • short—Specifies that the default port path costs are within the range: 1–65,535.

Default Configuration

Long path cost method.

Command Mode

Global Configuration mode

User Guidelines

This command applies to all the spanning tree instances on the switch.

  • If the short method is selected, the switch calculates the default cost as 100.

  • If the long method is selected, the switch calculates the default cost as 20000.

Example

The following example sets the default path cost method to Long.

switchxxxxxx(config)#  spanning-tree pathcost method long

spanning-tree bpdu (Global)

Use the spanning-tree bpdu Global Configuration mode command to define Bridge Protocol Data Unit (BPDU) handling when the spanning tree is disabled globally or on a single interface. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree bpdu {filtering | flooding}

no spanning-tree bpdu

Parameters

  • filtering—Specifies that BPDU packets are filtered when the spanning tree is disabled on an interface.

  • flooding—Specifies that untagged BPDU packets are flooded unconditionally (without applying VLAN rules) to all ports with the spanning tree disabled and BPDU handling mode of flooding. Tagged BPDU packets are filtered.

Default Configuration

The default setting is flooding.

Command Mode

Global Configuration mode

User Guidelines

The filtering and flooding modes are relevant when the spanning tree is disabled globally or on a single interface.

Example

The following example defines the BPDU packet handling mode as flooding when the spanning tree is disabled on an interface.

switchxxxxxx(config)#  spanning-tree bpdu flooding

spanning-tree bpdu (Interface)

Use the spanning-tree bpdu Interface (Ethernet, Port Channel) Configuration mode command to define BPDU handling when the spanning tree is disabled on a single interface. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree bpdu {filtering | flooding}

no spanning-tree bpdu

Parameters

  • filtering—Specifies that BPDU packets are filtered when the spanning tree is disabled on an interface.

  • flooding—Specifies that untagged BPDU packets are flooded unconditionally (without applying VLAN rules) to ports with the spanning tree disabled and BPDU handling mode of flooding. Tagged BPDU packets are filtered.

Default Configuration

The spanning-tree bpdu (Global) command determines the default configuration.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example defines the BPDU packet as flooding when the spanning tree is disabled on gi1/0/3.

switchxxxxxx(config)#  interface gi1/0/3
switchxxxxxx(config-if)#  spanning-tree bpdu flooding

spanning-tree guard root

Use the spanning-tree guard root Interface (Ethernet, Port Channel) Configuration mode command to enable Root Guard on all spanning-tree instances on the interface. Root guard prevents the interface from becoming the root port of the device. Use the no form of this command to disable the root guard on the interface.

Syntax

spanning-tree guard root

no spanning-tree guard root

Default Configuration

Root guard is disabled.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

Root Guard can be enabled when the device operates in any spanning tree mode.

When Root Guard is enabled, the port changes to the alternate state if the spanning-tree calculations select the port as the root port.

Example

The following example prevents gi1/0/1 from being the root port of the device.

switchxxxxxx(config)#  interface gi1/0/1
switchxxxxxx(config-if)#  spanning-tree guard root

spanning-tree bpduguard

Use the spanning-tree bpduguard Interface (Ethernet, Port Channel) Configuration mode command to shut down an interface when it receives a Spanning Tree message. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree bpduguard {enable | disable}

no spanning-tree bpduguard

Parameters

  • enable—Enables BPDU Guard.

  • disable—Disables BPDU Guard.

Default Configuration

BPDU Guard is disabled.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The command can be enabled when the spanning tree is enabled (useful when the port is in the PortFast mode) or disabled.

Example

The following example shuts down gi1/0/5 when it receives a BPDU.

switchxxxxxx(config)#  interface gi1/0/5
switchxxxxxx(config-if)#  spanning-tree bpduguard enable

clear spanning-tree counters

Use the clear spanning-tree counters Privileged EXEC mode command to clear STP counters on all interfaces or on the specified interface

Syntax

clear spanning-tree counters [interface interface-id]

Parameters

  • interface-id— (O'ptional) Specifies an interface ID. The interface ID can be one of the following types: Ethernet port or Port-channel.

Default Configuration

All interfaces.

Command Mode

Privileged EXEC mode

User Guidelines

The clear spanning-tree counters command clears sent and received STP BPDU counters from the entire switch or from the specified interface

Example

This example shows how to clear STP counter on all interfaces.

switchxxxxxx# clear spanning-tree counters

clear spanning-tree detected-protocols

Use the clear spanning-tree detected-protocols Privileged EXEC mode command to restart the STP migration process (force renegotiation with neighboring switches) on all interfaces or on the specified interface

Syntax

clear spanning-tree detected-protocols [interface interface-id]

Parameters

  • interface-id—Specifies an interface ID. The interface ID can be one of the following types: Ethernet port or Port-channel.

Default Configuration

All interfaces.

Command Mode

Privileged EXEC mode

User Guidelines

This feature can only be used when working in the RSTP, MSTP, or Rapid PVST mode.

Example

This restarts the STP migration process on all interfaces.

switchxxxxxx#  clear spanning-tree detected-protocols

spanning-tree mst priority

Use the spanning-tree mst priority Global Configuration mode command to configure the device priority for the specified spanning-tree instance. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree mst instance-id priority priority

no spanning-tree mst instance-id priority

Parameters

  • instance-id—Specifies the spanning-tree instance ID. (Range:1– 7 )

  • priority—Specifies the device priority for the specified spanning-tree instance. This setting determines 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. (Range: 0–61440)

Default Configuration

The default priority is 32768.

Command Mode

Global Configuration mode

User Guidelines

The priority value must be a multiple of 4096.

The switch with the lowest priority is the root of the spanning tree.

Example

The following example configures the spanning tree priority of instance 1 to 4096.

switchxxxxxx(config)#  spanning-tree mst 1 priority 4096

spanning-tree mst max-hops

Use the spanning-tree mst max-hops Global Configuration mode command to configure the number of hops in an MST region before the BDPU is discarded and the port information is aged out. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree mst max-hops hop-count

no spanning-tree mst max-hops

Parameters

  • hop-count—Specifies the number of hops in an MST region before the BDPU is discarded. (Range: 1–40)

Default Configuration

The default number of hops is 20.

Command Mode

Global Configuration mode

Example

The following example configures the maximum number of hops that a packet travels in an MST region before it is discarded to 10.

switchxxxxxx(config)#  spanning-tree mst max-hops 10 

spanning-tree mst port-priority

Use the spanning-tree mst port-priority Interface (Ethernet, Port Channel) Configuration mode command to configure the priority of a port. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree mst instance-id port-priority priority

no spanning-tree mst instance-id port-priority

Parameters

  • instance-id—Specifies the spanning tree instance ID. (Range:1– 7 )

  • priority—Specifies the port priority. (Range: 0–240 in multiples of 16)

Default Configuration

The default port priority is 128.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The priority value must be a multiple of 16.

Example

The following example configures the port priority of gi1/0/1 to 144.

switchxxxxxx(config)#  interface gi1/0/1
switchxxxxxx(config-if)#  spanning-tree mst 1 port-priority 144

spanning-tree mst cost

Use the spanning-tree mst cost Interface (Ethernet, Port Channel) Configuration mode command to configure the path cost for MST calculations. If a loop occurs, the spanning tree considers path cost when selecting an interface to put in the Forwarding state. Use the no form of this command to restore the default configuration.

Syntax

spanning-tree mst instance-id cost cost

no spanning-tree mst instance-id cost

Parameters

  • instance-id—Specifies the spanning-tree instance ID. (Range:1– 7 )

  • cost—Specifies the port path cost. (Range: 1–200000000)

Default Configuration

Default path cost is determined by the port speed and path cost method (long or short) as shown below:

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example configures the MSTP instance 1 path cost for port gi1/0/9 to 4.

switchxxxxxx(config)#  interface gi1/0/9
switchxxxxxx(config-if)#  spanning-tree mst 1 cost 4

spanning-tree mst configuration

Use the spanning-tree mst configuration Global Configuration mode command to enable configuring an MST region by entering the MST mode.

Syntax

spanning-tree mst configuration

Command Mode

Global Configuration mode

User Guidelines

For two or more switches to be in the same MST region, they must contain the same VLAN mapping, the same configuration revision number, and the same name.

Example

The following example configures an MST region.

switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst)# instance 1 vlan 10-20
switchxxxxxx(config-mst)# name region1
switchxxxxxx(config-mst)# revision 1

instance (MST)

Use instance MST Configuration mode command to map VLANs to an MST instance. Use the no form of this command to restore the default mapping.

Syntax

instance instance-id vlan vlan-range

no instance instance-id vlan vlan-range

Parameters

  • instance-id—MST instance (Range:1– 7)

  • vlan-range—The specified range of VLANs is added to the existing ones. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 1–4094)

Default Configuration

All VLANs are mapped to the common and internal spanning tree (CIST) instance (instance 0).

Command Mode

MST Configuration mode

User Guidelines

Before mapping VLANs to an instance, the instance needs to be created using the spanning-tree mst instance command (up to 15 instances can be created).

All VLANs that are not explicitly mapped to an MST instance are mapped to the common and internal spanning tree (CIST) instance (instance 0) and cannot be unmapped from the CIST.

For two or more devices to be in the same MST region, they must have the same VLAN mapping, the same configuration revision number, and the same name.

Examples

Example 1. The following example maps VLANs 10-20 to MST instance 1000.

switchxxxxxx(config)# spanning-tree mst instance 1000
switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst)# instance 1000 vlan 10-20

Example 2. In the following example the attempt to map VLANs to MST instance ID 1001 fails, since instance ID 1001 was not created by user:

switchxxxxxx(config)# spanning-tree mst configuration
switchxxxxxx(config-mst)# instance 1000 vlan 30-40
Cannot map VLANs to instance 1001. Instance 1001 does not exist.

name (MST)

Use the name MST Configuration mode command to define the MST region name. Use the no form of this command to restore the default setting.

Syntax

name string

no name

Parameters

  • string—Specifies the MST region name. (Length: 1–32 characters)

Default Configuration

The default name is the bridge MAC address.

Command Mode

MST Configuration mode

Example

The following example defines the region name as Region1.

switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst)# name region1

revision (MST)

Use the revision MST Configuration mode command to define the MST configuration revision number. Use the no form of this command to restore the default configuration.

Syntax

revision value

no revision

Parameters

  • value—Specifies the MST configuration revision number. (Range: 0–65535)

Default Configuration

The default configuration revision number is 0.

Command Mode

MST Configuration mode

Example

The following example sets the configuration revision to 1.

switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst) # revision 1

show (MST)

Use the show MST Configuration mode command to display the current or pending MST region configuration.

Syntax

show {current | pending}

Parameters

  • current—Displays the current MST region configuration.

  • pending—Displays the pending MST region configuration.

Command Mode

MST Configuration mode

Example

The following example displays a pending MST region configuration

switchxxxxxx(config-mst)# show pending
Gathering information ..........
Current MST configuration
Name: Region1
Revision: 1
Digest: 0xB41829F9030A054FB74EF7A8587FF58D
Instance  VLANs Mapped               State
--------  ------------------------   -----
0         1-4094                     Disabled
switchxxxxxx(config-mst)# 

exit (MST)

Use the exit MST Configuration mode command to exit the MST region Configuration mode and apply all configuration changes.

Syntax

exit

Command Mode

MST Configuration mode

Example

The following example exits the MST Configuration mode and saves changes.

switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst)# exit
switchxxxxxx(config)# 

abort (MST)

Use the abort MST Configuration mode command to exit the MST Configuration mode without applying the configuration changes.

Syntax

abort

Command Mode

MST Configuration mode

Example

The following example exits the MST Configuration mode without saving changes.

switchxxxxxx(config)#  spanning-tree mst configuration
switchxxxxxx(config-mst)# abort

spanning-tree mst instance

Use the spanning-tree mst instance Global Configuration mode command to create an MST instance to which VLANs can be mapped. To delete an instance use the no form of command.

Syntax

spanning-tree mst instance instance-id

no spanning-tree mst instance instance-id

Parameters

  • instance-id—Specifies the spanning-tree instance ID. (range 1-4094)

Default Configuration

Instance IDs 1-4094 do not exist.

Command Mode

Global Configuration mode

User Guidelines

Use the spanning-tree mst instance command to create an MST instance. Up to 15 can be created. Instance 0 (the common and internal spanning tree (CIST) instance) exists by default on device and cannot be removed.

Creating an MST instance allows to map VLANs to this instance in MST Configuration mode) and to configure the following settings on the created instance:

Use the no form of command to delete an instance. An instance cannot be deleted if one or more VLANs are still mapped to it. Deleting an instance removes all STP configuration related to that instance.

Example

Example 1. The following example creates an MST instance with instance ID of 248:

switchxxxxxx(config)#spanning-tree mst instance 248

Example 2:The following example removes MST instance 248 from device.

switchxxxxxx(config)# no spanning-tree mst instance 248

Example 3:In the following example removal of instance ID 365 fails because VLANs are still mapped to this instance:

switchxxxxxx(config)# no spanning-tree mst instance 365
Cannot delete instance 365. One or more VLANs are mapped to this instance.

show spanning-tree

Use the show spanning-tree Privileged EXEC mode command to display the spanning-tree configuration.

Syntax

show spanning-tree [interface-id] [{instance instance-id} | {vlan vlan-id}]

show spanning-tree [detail] [active | blockedports] [{instance instance-id} | {vlan vlan-id}]

show spanning-tree inconsistentports

show spanning-tree mst-configuration

show spanning-tree mst-configuration digest

Parameters

  • interface-id—Specifies an interface ID (optional). The interface ID can be one of the following types: Ethernet port or Port-channel.

  • detail—Displays detailed information.

  • active—Displays active ports only. Active ports are ports that are STP enabled and in the operational status of up. If device mode is PVST+ or Rapid PVST+ - ports also need to be members of the displayed VLAN.

  • blockedports—Displays blocked ports only.

  • instance-id—MST instance (Range:1– 7). The parameter could be defined only when mode MSTP is enabled.

  • vlan vlan-id—Specifies the VLAN ID. (Range: 1–4094). The parameter could be defined only when mode PVST or RPVST is enabled.

  • inconsistentports - Displays the ports that are in an inconsistent STP state. Command is relevant only when in PVST+ or Rapid PVST mode.

  • mst-configuration—Displays the MST configuration information.

  • mst-configuration digest—Displays the MST configuration digest information.

Default Configuration

If no interface is specified, the default is all interfaces.

Command Mode

Privileged EXEC mode

User Guidelines

This command only works when MST is enabled.

Example

The following examples display spanning-tree information in various configurations:

  • Display examples for a device that is in STP or RSTP mode -

    switchxxxxxx#  show spanning-tree
    Spanning tree enabled mode RSTP
    Default port cost method: long
    Loopback guard: Disabled
    

Root ID

Priority
Address
Cost
Port

32768
00:01:42:97:e0:00
20000
gi1/0/1

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5

State
------
Enabled
Enabled
Disabled
Enabled
Enabled

Prio. No
------
128.1
128.2
128.3
128.4
128.5

Cost
-----
20000
20000
20000
20000
20000

Sts
---
FRW
FRW
-
BLK
DIS

Role
----
Root
Desg
-
Altn
-

PortFast
-------   
No
No
-
No
-

Type
----------
P2p (RSTP)
Shared (STP)
-
Shared (STP)
-
switchxxxxxx# show spanning-tree
Spanning tree disabled (BPDU filtering) mode RSTP
Default port cost method: long
Loopback guard: Disabled
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5

State
--------
Enabled
Enabled
Disabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.3
128.4
128.5

Cost
-----
20000
20000
20000
20000
20000

Sts
---
FRW
FRW
-
FRW
DIS

Role
----
Desg
Desg
-
Desg
-

PortFast
---------
No
No
-
No
-

Type
----------
P2p (RSTP)
Shared (STP)
-
Shared (STP)
-
switchxxxxxx#  show spanning-tree
Spanning tree disabled (BPDU filtering) mode RSTP
Default port cost method: long
Loopback guard: Disabled

Root ID

Priority
Address
Path Cost
Root Port
Hello Time

N/A
N/A
N/A
N/A
N/A

Max Age N/A

Forward Delay N/A

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Interfaces

Name
---------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5

State
--------
Enabled
Enabled
Disabled
Enabled
Enabled

Prio.Nb
-------
128.1
128.2
128.3
128.4
128.5

Cost
-----
20000
20000
20000
20000
20000

Sts
---
-
-
-
-
-

Role
----
-
-
-
-
-

PortFast
---------
-
-
-
-
-

Type
----------
-
-
-
-
-
switchxxxxxx#  show spanning-tree active
Spanning tree enabled mode RSTP
Default port cost method: long
Loopback guard: Disabled

Root ID

Priority
Address
Path Cost
Root Port

32768
00:01:42:97:e0:00
20000
gi1/0/1

Hello Time 2 sec

Max Age 20 sec


Forward Delay 15 sec

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
---------
gi1/0/1
gi1/0/2
gi1/0/4

State
--------
Enabled
Enabled
Enabled

Prio.Nbr
------
128.1
128.2
128.4

Cost
-----
20000
20000
20000

Sts
---
FRW
FRW
BLK

Role
----
Root
Desg
Altn

PortFast
---------
No
No
No

Type
----------
P2P (RSTP)
Shared (STP)
Shared (STP)
switchxxxxxx#  show spanning-tree blockedports
Spanning tree enabled mode RSTP
Default port cost method: long
Loopback guard: Disabled

Root ID

Priority
Address
Path Cost
Root Port

32768
00:01:42:97:e0:00
20000
gi1/0/1

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Bridge ID

Priority

36864

Address

00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
---------
gi1/0/4

State
-------
Enabled

Prio.Nbr
------
128.4

Cost
-----
19

Sts
---
BLK

Role
----
Altn

PortFast
--------
No

Type
----------
Shared (STP)
switchxxxxxx#  show spanning-tree detail
Spanning tree enabled mode RSTP
Default port cost method: long
Loopback guard: Disabled

Root ID

Priority
Address
Path Cost
Root Port

32768
00:01:42:97:e0:00
20000
gi1/0/1

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Number of topology changes 2 last change occurred 2d18h ago

Times:

hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Port 1 (gi1/0/1) enabled
State: Forwarding
Port id: 128.1
Type: P2p (configured: auto) RSTP
Designated bridge Priority: 32768
Designated port id: 128.25
Guard root: Disabled
Role: Root
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:01:42:97:e0:00
Designated path cost: 0
BPDU guard: Disabled
Number of transitions to forwarding state: 1
BPDU: sent 2, received 120638
Port 2 (gi1/0/2) enabled
State: Forwarding
Port id: 128.2
Type: Shared (configured: auto) STP
Designated bridge Priority: 32768
Designated port id: 128.2
Guard root: Disabled
Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000
BPDU guard: Disabled
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638
Port 3 (gi1/0/3) disabled
State: N/A
Port id: 128.3
Type: N/A (configured: auto)
Designated bridge Priority: N/A
Designated port id: N/A
Guard root: Disabled
Role: N/A
Port cost: 20000
Port Fast: N/A (configured:no)
Address: N/A
Designated path cost: N/A
BPDU guard: Disabled
Number of transitions to forwarding state: N/A
BPDU: sent N/A, received N/A
Port 4 (gi1/0/4) enabled
State: Blocking
Port id: 128.4
Type: Shared (configured:auto) STP
Designated bridge Priority: 28672
Designated port id: 
128.25
Guard root: Disabled
Role: Alternate
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:30:94:41:62:c8
Designated path cost: 20000
BPDU guard: Disabled
Number of transitions to forwarding state: 1
BPDU: sent 2, received 120638
Port 5 (gi1/0/5) enabled
State: Disabled
Port id: 128.5
Type: N/A (configured: auto)
Designated bridge Priority: N/A
Designated port id: N/A
Guard root: Disabled
Role: N/A
Port cost: 20000
Port Fast: N/A (configured:no)
Address: N/A
Designated path cost: N/A
BPDU guard: Disabled
Number of transitions to forwarding state: N/A
BPDU: sent N/A, received N/A
switchxxxxxx#  show spanning-tree ethernet gi1/0/1
Port 1 (gi1/0/1) enabled
State: Forwarding
Port id: 128.1
Type: P2p (configured: auto) RSTP
Designated bridge Priority: 32768
Designated port id: 128.25
Guard root: Disabled
Role: Root
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:01:42:97:e0:00
Designated path cost: 0
BPDU guard: Disabled
Number of transitions to forwarding state: 1
BPDU: sent 2, received 120638
  • Display examples for a device that is in PVST or Rapid PVST mode-

    switchxxxxxx#  show spanning-tree
    Spanning tree enabled mode Rapid-PVST
    Default port cost method: long
    Loopback guard: Disabled
    VLAN 1
    

Root ID

Priority
Address
Path Cost
Root Port

4096
00:01:42:97:e0:00
20000
gi1/0/1
Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5
gi1/0/6

State
--------
Enabled
Enabled
Disabled
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.3
128.4
128.5
128.6

Cost
-----
20000
20000
20000
20000
20000
20000

Sts
---
Frw
DSCR
-
Dsbl
DSCR
Frw

Role
----
Root
Bkup
-
Dsbl
Altn
Desg

PortFast
--------No
No
No
No
No
Yes

Type
----------
P2P (RPVST)
P2P (RVPST)
-
-
P2P (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
VLAN 20

Root ID

Priority
Address

4096
00:02:4b:29:7a:00
This switch is the root
Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5
gi1/0/6

State
--------
Enabled
Enabled
Disabled
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.3
128.4
128.5
128.6

Cost
-----
20000
20000
20000
20000
20000
20000

Sts
---
FRW
Dscr*
Dsbl
Dsbl
Dsbl
Frw

Role
----
Desg
Desg
Dsbl
Dsbl
Dsbl
Desg

PortFast
--------No
No
No
No
no
Yes

Type
----------
P2p (RPVST)
P2p (RPVST)
-
-
P2P (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
switchxxxxxx#  show spanning-tree active
Spanning tree enabled mode Rapid-PVST
Default port cost method: long
Loopback guard: Disabled
VLAN 1

Root ID
Priority
Address
Path Cost
Root Port
4096
00:01:42:97:e0:00
20000
gi1/0/1
Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

Bridge ID

Priority
Address

36864
00:02:4b:29:7a:00

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/5
gi1/0/6

State
--------
Enabled
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.5
128.6

Cost
-----
20000
20000
20000
20000

Sts
---
Frw
DSCR
DSCR
Frw

Role
----
Root
Bkup
Altn
Desg

PortFast
--------No
No
No
Yes

Type
----------
P2p (RPVST)
P2p (RPVST)
P2p (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
VLAN 20

Root ID

Priority
Address

4096
00:02:4b:29:7a:00
This switch is the root
Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/6

State
--------
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.6

Cost
-----
20000
20000
20000

Sts
---
FRW
Dscr*
Frw

Role
----
Desg
Desg
Desg

PortFast
--------No
No
Yes

Type
----------
P2p (RPVST)
P2p (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
switchxxxxxx#  show spanning-tree VLAN 20
Spanning tree enabled mode PVST
Default port cost method: long
Loopback guard: Disabled
VLAN 20

Root ID

Priority
Address

4096
00:02:4b:29:7a:00
This switch is the root
Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Interfaces

Name
--------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4
gi1/0/5
gi1/0/6

State
--------
Enabled
Enabled
Disabled
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.3
128.4
128.5
128.6

Cost
-----
20000
20000
20000
20000
20000
20000

Sts
---
FRW
Dscr*
Dsbl
Dsbl
Dsbl
Frw

Role
----
Desg
Desg
Dsbl
Dsbl
Dsbl
Desg

PortFast
--------No
No
No
No
no
Yes

Type
----------
P2p (RPVST)
P2p (RPVST)
-
-
P2P (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
switchxxxxxx#  show spanning-tree gi1/0/2

VLAN
--------
1
2
3
6

State
--------
Enabled
Enabled
Enabled
Enabled

Prio.Nbr
---------
128.1
128.2
128.3
128.6

Cost
-----
2000
2000
2000
2000

Sts
---
FRW
Dscr*
Dscr
Frw

Role
----
Root
Desg
Altr
Desg

PortFast
--------No
No
No
Yes

Type
----------
P2p (RPVST)
P2p (RPVST)
P2p (RPVST)
Shared(PVST)
* Port Type or PVID Inconsistency
switchxxxxxx#  show spanning-tree gi1/0/2 vlan 3

(gi1/0/2) enabled
State: Discarding
Port id: 128.3
Type: P2p (configured: auto) RPVST
Designated bridge Priority: 32768
Designated port id: 128.22
Guard root: Disabled

Role: Alternate
Port cost: 2000
Port Fast: No (configured:Auto)
Address: 00:01:42:97:e0:00
Designated path cost: 0
BPDU guard: Disabled
switchxxxxxx#  show spanning-tree inconsistentports

name
----

interface
---------

inconsistency
-------------

VLAN 10

gi1/0/2

Port Type Inconsistency

VLAN 10

gi1/0/7

PVID Inconsistency

VLAN 20

gi1/0/7

PVID Inconsistency

VLAN 20

gi1/0/8

Port Type Inconsistency
Number of inconsistent ports (segments) in the system : 4
  • Display examples for a device that is in MSTP mode -

    switchxxxxxx#  show spanning-tree mst-configuration
    Name: Region1
    Revision: 1
    

Instance
--------
1
2

Vlans mapped
------------
1-9, 21-4094
10-20

State
---------
Enabled
Enabled
switchxxxxxx#  show spanning-tree mst-configuration digest
Name: Region1
Revision: 1
Format selector: 0
Digest: 0xB41829F9030A054FB74EF7A8587FF58D
Number of instances configured: 3
switchxxxxxx#  show spanning-tree
Spanning tree enabled mode MSTP
Default port cost method: long
Loopback guard: Disabled
###### MST 0 Vlans Mapped: 1-9

CST Root ID

Priority
Address
Path Cost
Root Port

32768
00:01:42:97:e0:00
20000
 gi1/0/1

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

IST Master ID

Priority
Address

32768
00:02:4b:29:7a:00
This switch is the IST master.

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Max hops 20
Interfaces

Name
----
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4

State
-------
Enabled
Enabled
Enabled
Enabled

Prio.Nbr
--------
128.1
128.2
128.3
128.4

Cost
-----
20000
20000
20000
20000

Sts
---
FRW
FRW
FRW
FRW

Role
----
Root
Desg
Desg
Desg

PortFast
--------
No
No
No
No

Type
-------------
P2p Bound (RSTP)
Shared Bound (STP)
P2p
P2p
###### MST 1 Vlans Mapped: 10-20

Root ID

Priority
Address
Path Cost
Root Port
Rem hops

24576
00:02:4b:29:89:76
20000
 gi1/0/4
19

Bridge ID

Priority
Address

32768
00:02:4b:29:7a:00
Interfaces

Name
----
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4

State
-------
Enabled
Enabled
Enabled
Enabled

Prio.Nbr
--------
128.1
128.2
128.3
128.4

Cost
-----
20000
20000
20000
20000

Sts
---
FRW
FRW
BLK
FRW

Role
----
Boun
Boun
Altn
Root

PortFast
--------
No
No
No
No

Type
-------------
P2p Bound  (RSTP)
Shared Bound (STP)
P2p
P2p
switchxxxxxx#  show spanning-tree detail
Spanning tree enabled mode MSTP
Default port cost method: long
Loopback guard: Disabled
###### MST 0 Vlans Mapped: 1-9

CST Root ID

Priority
Address
Path Cost
Root Port

32768
00:01:42:97:e0:00
20000
 gi1/0/1

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec

IST Master ID

Priority
Address

32768
00:02:4b:29:7a:00
This switch is the IST master.

Hello Time 2 sec

Max Age 20 sec

Forward Delay 15 sec
Max hops 20
Number of topology changes 2 last change occurred 2d18h ago
Times:  hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15

Port 1 (gi1/0/1) enabled
State: Forwarding
Port id: 128.1
Type: P2p (configured: auto) Boundary RSTP
Designated bridge Priority: 32768
Designated port id: 128.25
Number of transitions to forwarding state: 1
BPDU: sent 2, received 120638

Role: Root
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:01:42:97:e0:00
Designated path cost: 0

Port 2 (gi1/0/2) enabled
State: Forwarding
Port id: 128.2
Type: Shared (configured: auto) Boundary STP
Designated bridge Priority: 32768
Designated port id: 128.2
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000

Port 3 (gi1/0/3) enabled
State: Forwarding
Port id: 128.3
Type: Shared (configured: auto) Internal
Designated bridge Priority: 32768
Designated port id: 128.3
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000

Port 4 (gi1/0/4) enabled
State: Forwarding
Port id: 128.4
Type: Shared (configured: auto) Internal
Designated bridge Priority: 32768
Designated port id: 128.2
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000
###### MST 1 Vlans Mapped: 10-20

Root ID

Priority
Address
Path Cost
Root Port

24576
00:02:4b:29:89:76
20000
 gi1/0/4
Rem hops 19

Bridge ID

Priority
Address

32768
00:02:4b:29:7a:00
Number of topology changes 2 last change occurred 1d9h ago
Times:  hold 1, topology change 2, notification 2
hello 2, max age 20, forward delay 15

Port 1 (gi1/0/1) enabled
State: Forwarding
Port id: 128.1
Type: P2p (configured: auto) Boundary RSTP
Designated bridge Priority: 32768
Designated port id: 128.1
Number of transitions to forwarding state: 1
BPDU: sent 2, received 120638

Role: Boundary
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000

Port 2 (gi1/0/2) enabled
State: Forwarding
Port id: 128.2
Type: Shared (configured: auto) Boundary STP
Designated bridge Priority: 32768
Designated port id: 128.2
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000

Port 3 (gi1/0/3) disabled
State: Blocking
Port id: 128.3
Type: Shared (configured: auto) Internal
Designated bridge Priority: 32768
Designated port id: 128.78
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Alternate
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:1a:19
Designated path cost: 20000

Port 4 (gi1/0/4) enabled
State: Forwarding
Port id: 128.4
Type: Shared (configured: auto) Internal
Designated bridge Priority: 32768
Designated port id: 128.2
Number of transitions to forwarding state: 1
BPDU: sent 2, received 170638

Role: Designated
Port cost: 20000
Port Fast: No (configured:no)
Address: 00:02:4b:29:7a:00
Designated path cost: 20000

show spanning-tree bpdu

Use the show spanning-tree bpdu User EXEC mode command to display the BPDU handling when spanning-tree is disabled.

Syntax

show spanning-tree bpdu [interface-id | detailed]

Parameters

  • interface-id—Specifies an interface ID. The interface ID can be one of the following types: Ethernet port or Port-channel.

  • detailed—Displays information for non-present ports in addition to present ports.

Default Configuration

Show information for all interfaces. If detailed is not used, only present ports are displayed.

Command Mode

User EXEC mode

Example

The following examples display spanning-tree BPDU information:

switchxxxxxx#  show spanning-tree bpdu
The following is the output if the global BPDU handling command is not supported.

Interface
---------
gi1/0/1
gi1/0/2
gi1/0/3

Admin Mode
----------
Filtering
Filtering
Filtering

Oper Mode
---------
Filtering
Filtering
Guard
The following is the output if both the global BPDU handling command and the per-interface BPDU handling command are supported.
Global: Flooding

Interface
---------
gi1/0/1
gi1/0/2
gi1/0/3

Admin Mode
----------
Global
Global
Flooding

Oper Mode
---------
Flooding
STP
STP

spanning-tree loopback-guard

Use the spanning-tree loopback-guard global configuration command to shut down an interface if it receives a loopback BPDU. Use the no form of this command to return the default setting.

Syntax

spanning-tree loopback-guard

no spanning-tree loopback-guard

Command Mode

Global

User Guidelines

This enables shutting down all interfaces if a loopback BPDU is received on it.

Example

switchxxxxxx(config)#  spanning-tree loopback-guard

spanning-tree vlan forward-time

To configure the spanning-tree bridge forward time for a VLAN, use the spanning-tree vlan forward-time command in Global Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range forward-time seconds

no spanning-tree vlan vlan-range forward-time

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • seconds—Specifies the spanning-tree forward time in seconds. (Range: 4–30)

Default Configuration

The default forward time is 15 seconds.

Command Mode

Global Configuration mode

User Guidelines

The spanning-tree bridge forward time is the amount of time a port remains in the listening and learning states before entering the forwarding state.

When configuring the forwarding time, the following relationship should be maintained:

  • 2*(Forward-Time - 1) >= Max-Age

Use this command to configure the forward time for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

Example

The following example configures the spanning tree bridge forwarding time to 25 seconds for VLAN 100:

switchxxxxxx(config)#  spanning-tree vlan 100 forward-time 25

spanning-tree vlan hello-time

To configure the spanning-tree bridge hello time for a VLAN, use the spanning-tree vlan hello-time command in Global Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range hello-time seconds

no spanning-tree vlan vlan-range hello-time

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • seconds—Specifies the spanning-tree Hello time in seconds. (Range: 1–10)

Default Configuration

The default hello time is 2 seconds.

Command Mode

Global Configuration mode

User Guidelines

The spanning-tree bridge hello time is the time between two sequential sent Hello messages.

When configuring the Hello time, the following relationship should be maintained:

Max-Age >= 2*(Hello-Time + 1)

Use this command to configure the hello time for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

Example

The following example configures the spanning-tree bridge hello time to 5 seconds for VLANs 100-101:

switchxxxxxx(config)#  spanning-tree vlan 100-101 hello-time 5

spanning-tree vlan max-age

To configure the spanning-tree bridge maximum age time for a VLAN, use the spanning-tree vlan max-age command in Global Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range max-age seconds

no spanning-tree vlan vlan-range max-age

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • seconds—Specifies the spanning-tree bridge maximum age in seconds. (Range: 6–40)

Default Configuration

The default max-age value is 15 seconds.

Command Mode

Global Configuration mode

User Guidelines

When configuring the maximum age, the following relationships should be maintained:

2*(Forward-Time - 1) >= Max-Age

Max-Age >= 2*(Hello-Time + 1)

Use this command to configure the maximum age for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

Example

The following example configures the spanning-tree bridge maximum age to 10 seconds for VLAN 100:

switchxxxxxx(config)#  spanning-tree vlan 100 max-age 10

spanning-tree vlan priority

To configure the spanning-tree bridge priority for a VLAN, use the spanning-tree vlan priority command in Global Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range priority priority

no spanning-tree vlan vlan-range priority

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • priority—Specifies the bridge priority. (Range: 0–61440)

Default Configuration

The default priority equal to 32768.

Command Mode

Global Configuration mode

User Guidelines

The priority value must be a multiple of 4096.

The switch with the lowest priority is the root of the spanning tree. When more than one switch has the lowest priority, the switch with the lowest MAC address is selected as the root.

Use this command to configure the bridge priority for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

Example

The following example configures the spanning-tree priority to 12288 for VLAN 100-105:

switchxxxxxx(config)#  spanning-tree vlan 100-105 priority 12288

spanning-tree vlan cost

To configure the spanning-tree bridge path cost for a port and a VLAN, use the spanning-tree vlan cost command in Interface (Ethernet, Port Channel) Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range cost cost

no spanning-tree vlan vlan-range cost

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • cost—Specifies the port path cost. (Range: 1–200000000)

Default Configuration

Default path cost is determined by port speed and path cost method (long or short).

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

Use this command to configure the port cost for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

The VLAN instances that can be specified are VLAN ID 2-4094.

Example

The following example configures the spanning-tree cost to 35000 for port gi1/0/15 and VLAN 100:

switchxxxxxx(config)#  interface gi1/0/15
switchxxxxxx(config-if)#  spanning-tree vlan 100 cost 35000

spanning-tree vlan port-priority

To configure the spanning-tree port priority for a VLAN, use the spanning-tree vlan port-priority command in Interface (Ethernet, Port Channel) Configuration mode. To return to the default settings, use the no form of this command.

Syntax

spanning-tree vlan vlan-range port-priority priority

no spanning-tree vlan vlan-range port-priority

Parameters

  • vlan-range—Specifies a range of VLANs to configure. To specify a range, use a hyphen. To specify a series, use a comma. (Range: 2–4094)

  • priority—Specifies the port priority. (Range: 0–240)

Default Configuration

The default port priority is 128.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The priority value must be a multiple of 16.

Use this command to configure the port priority for the specified VLAN instance. Setting will take effect if Spanning-tree mode is set to PVST or Rapid PVST .

Example

The following example configures the spanning priority on gi1/0/15 to 16 for VLANs 100-102:

switchxxxxxx(config)#  interface gi1/0/15-16
switchxxxxxx(config-if)#  spanning-tree vlan 100-102 port-priority 96