This section describes the commands you use to configure Spanning Tree Protocol (STP). STP helps prevent network loops, duplicate messages, and network instability.
NOTE: STP is disabled by default. When you enable STP on the switch, STP is still disabled on each port. If STP is disabled, the system does not forward BPDU messages.
spanning-tree
This command sets the spanning-tree operational mode to enabled.
Default: disabled
Format: spanning-tree
Mode: Global Config
no spanning-tree
This command sets the spanning-tree operational mode to disabled. While disabled, the spanning-tree configuration is retained and can be changed, but is not activated.
Format: no spanning-tree
Mode: Global Config
spanning-tree bpdufilter
Use this command to enable BPDU Filter on an interface or range of interfaces.
Default: disabled
Format: spanning-tree bpdufilter
Mode: Interface Config
no spanning-tree bpdufilter
Use this command to disable BPDU Filter on the interface or range of interfaces.
Default: disabled
Format: no spanning-tree bpdufilter
Mode: Interface Config
spanning-tree bpdufilter default
Use this command to enable BPDU Filter on all the edge port interfaces.
Default: disabled
Format: spanning-tree bpdufilter
Mode: Global Config
no spanning-tree bpdufilter default
Use this command to disable BPDU Filter on all the edge port interfaces.
Default: disabled
Format: no spanning-tree bpdufilter default
Mode: Global Config
spanning-tree bpduflood
Use this command to enable BPDU Flood on an interface or range of interfaces.
Default: disabled
Format: spanning-tree bpduflood
Mode: Interface Config
no spanning-tree bpduflood
Use this command to disable BPDU Flood on the interface or range of interfaces.
Default: disabled
Format: no spanning-tree bpduflood
Mode: Interface Config
spanning-tree bpduguard
Use this command to enable BPDU Guard on the switch.
Default: disabled
Format: spanning-tree bpduguard
Mode: Global Config
no spanning-tree bpduguard
Use this command to disable BPDU Guard on the switch.
Default: disabled
Format: no spanning-tree bpduguard
Mode: Global Config
spanning-tree bpdumigrationcheck
Use this command to force a transmission of rapid spanning tree (RSTP) and multiple spanning tree (MSTP) BPDUs. Use the <unit/slot/port> parameter to transmit a BPDU from a specified interface, or use the all keyword to transmit BPDUs from all interfaces. This command forces the BPDU transmission when you execute it, so the command does not change the system configuration or have a “no” version.
This command sets the Configuration Identifier Name for use in identifying the configuration that this switch is currently using. The <name> is a string of up to 32 characters.
Default: base MAC address in hexadecimal notation
Format: spanning-tree configuration name <name>
Mode: Global Config
no spanning-tree configuration name
This command resets the Configuration Identifier Name to its default.
Format: no spanning-tree configuration name
Mode: Global Config
spanning-tree configuration revision
This command sets the Configuration Identifier Revision Level for use in identifying the configuration that this switch is currently using. The Configuration Identifier Revision Level is a number in the range of 0 to 65535.
This command sets the Configuration Identifier Revision Level for use in identifying the configuration that this switch is currently using to the default value.
Format: no spanning-tree configuration revision
Mode: Global Config
spanning-tree edgeport
This command specifies that this port is an Edge Port within the common and internal spanning tree. This allows this port to transition to Forwarding State without delay.
Format: spanning-tree edgeport
Mode: Interface Config
no spanning-tree edgeport
This command specifies that this port is not an Edge Port within the common and internal spanning tree.
Format: no spanning-tree edgeport
Mode: Interface Config
spanning-tree forceversion
This command sets the Force Protocol Version parameter to a new value. Use 802.1d to specify that the switch transmits ST BPDUs rather than MST BPDUs (IEEE 802.1d functionality supported). Use 802.1w to specify that the switch transmits RST BPDUs rather than MST BPDUs (IEEE 802.1w functionality supported). Use 802.1s to specify that the switch transmits MST BPDUs (IEEE 802.1s functionality supported).
This command sets the Force Protocol Version parameter to the default value.
Format: no spanning-tree forceversion
Mode: Global Config
spanning-tree forward-time
This command sets the Bridge Forward Delay parameter to a new value for the common and internal spanning tree. The forward-time value is in seconds within a range of 4 to 30, with the value being greater than or equal to “(Bridge Max Age / 2) + 1”.
Default: 15
Format: spanning-tree forward-time <4-30>
Mode: Global Config
no spanning-tree forward-time
This command sets the Bridge Forward Delay parameter for the common and internal spanning tree to the default value.
Format: no spanning-tree forward-time
Mode: Global Config
spanning-tree guard
This command selects whether loop guard or root guard is enabled on an interface or range of interfaces. If neither is enabled, then the port operates in accordance with the multiple spanning tree protocol.
Default: none
Format: spanning-tree guard {none | root | loop}
Mode: Interface Config
no spanning-tree guard
This command disables loop guard or root guard on the interface.
Format: no spanning-tree guard
Mode: Interface Config
spanning-tree max-age
This command sets the Bridge Max Age parameter to a new value for the common and internal spanning tree. The max-age value is in seconds within a range of 6 to 40, with the value being less than or equal to 2 x (<Bridge Forward Delay - 1>).
Default: 20
Format: spanning-tree max-age <6-40>
Mode: Global Config
no spanning-tree max-age
This command sets the Bridge Max Age parameter for the common and internal spanning tree to the default value.
Format: no spanning-tree max-age
Mode: Global Config
spanning-tree max-hops
This command sets the MSTP Max Hops parameter to a new value for the common and internal spanning tree. The max-hops value is a range from 1 to 127.
Default: 20
Format: spanning-tree max-hops <1-127>
Mode: Global Config
no spanning-tree max-hops
This command sets the Bridge Max Hops parameter for the common and internal spanning tree to the default value.
Format: no spanning-tree max-hops
Mode: Global Config
spanning-tree mst
This command sets the Path Cost or Port Priority for this port within the multiple spanning tree instance or in the common and internal spanning tree. If you specify an <mstid> parameter that corresponds to an existing multiple spanning tree instance, the configurations are done for that multiple spanning tree instance. If you specify 0 (defined as the default CIST ID) as the <mstid>, the configurations are done for the common and internal spanning tree instance.
If you specify the cost option, the command sets the path cost for this port within a multiple spanning tree instance or the common and internal spanning tree instance, depending on the <mstid> parameter. You can set the path cost as a number in the range of 1 to 200000000 or auto. If you select auto the path cost value is set based on Link Speed.
If you specify the port-priority option, this command sets the priority for this port within a specific multiple spanning tree instance or the common and internal spanning tree instance, depending on the <mstid> parameter. The port-priority value is a number in the range of 0 to 240 in increments of 16.
This command sets the Path Cost or Port Priority for this port within the multiple spanning tree instance, or in the common and internal spanning tree to the respective default values. If you specify an <mstid> parameter that corresponds to an existing multiple spanning tree instance, you are configuring that multiple spanning tree instance. If you specify 0 (defined as the default CIST ID) as the <mstid>, you are configuring the common and internal spanning tree instance.
If you specify the cost, this command sets the path cost for this port within a multiple spanning tree instance or the common and internal spanning tree instance, depending on the <mstid> parameter, to the default value, i.e. a path cost value based on the Link Speed. If you specify external-cost, this command sets the external path cost for this port for mst ‘0’ instance, to the default value, i.e. a path cost value based on the Link Speed.
If you specify port-priority, this command sets the priority for this port within a specific multiple spanning tree instance or the common and internal spanning tree instance, depending on the <mstid> parameter, to the default value.
Format: no spanning-tree mst <mstid> <cost | external-cost | port-priority>
Mode: Interface Config
spanning-tree cost <1-200000000>
This command sets the external cost as a number in the range of 1 to 200000000 or auto. If you specify auto, the external path cost value is set based on Link Speed.
This command adds a multiple spanning tree instance to the switch. The parameter <mstid> is a number within a range of 1 to 4094, that corresponds to the new instance ID to be added. The maximum number of multiple instances supported by the switch is 4.
Default: none
Format: spanning-tree mst instance <mstid>
Mode: Global Config
no spanning-tree mst instance
This command removes a multiple spanning tree instance from the switch and reallocates all VLANs allocated to the deleted instance to the common and internal spanning tree. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance to be removed.
Format: no spanning-tree mst instance <mstid>
Mode: Global Config
spanning-tree mst priority
This command sets the bridge priority for a specific multiple spanning tree instance. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance. The priority value is a number within a range of 0 to 61440 in increments of 4096. If you specify 0 (defined as the default CIST ID) as the <mstid>, this command sets the Bridge Priority parameter to a new value for the common and internal spanning tree. The bridge priority value is a number within a range of 0 to 61440. The twelve least significant bits are masked according to the 802.1s specification. This causes the priority to be rounded down to the next lower valid priority.
This command sets the bridge priority for a specific multiple spanning tree instance to the default value. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance. If 0 (defined as the default CIST ID) is passed as the <mstid>, this command sets the Bridge Priority parameter for the common and internal spanning tree to the default value.
Format: nospanning-tree mst priority <mstid>
Mode: Global Config
spanning-tree mst vlan
This command adds an association between a multiple spanning tree instance and a VLAN so that the VLAN is no longer associated with the common and internal spanning tree. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance. The <vlanid> corresponds to an existing VLAN ID.
Format: spanning-tree mst vlan <mstid> <vlanid>
Mode: Global Config
no spanning-tree mst vlan
This command removes an association between a multiple spanning tree instance and a VLAN so that the VLAN is again be associated with the common and internal spanning tree. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance. The <vlanid> corresponds to an existing VLAN ID.
Format: no spanning-tree mst vlan <mstid> <vlanid>
Mode: Global Config
spanning-tree port mode
This command sets the Administrative Switch Port State for this port to enabled.
Default: disabled
Format: spanning-tree port mode
Mode: Interface Config
no spanning-tree port mode
This command sets the Administrative Switch Port State for this port to disabled.
Format: no spanning-tree port mode
Mode: Interface Config
spanning-tree port mode all
This command sets the Administrative Switch Port State for all ports to enabled.
Default: disabled
Format: spanning-tree port mode all
Mode: Global Config
no spanning-tree port mode all
This command sets the Administrative Switch Port State for all ports to disabled.
Format: no spanning-tree port mode all
Mode: Global Config
show spanning-tree
This command displays spanning tree settings for the common and internal spanning tree. The following details are displayed.
Format: show spanning-tree
Modes: Privileged EXEC and User EXEC
The display parameters for above command are:
Bridge Priority: Specifies the bridge priority for the Common and Internal Spanning tree (CST). The value lies between 0 and 61440. It is displayed in multiples of 4096.
Bridge Identifier: The bridge identifier for the CST. It is made up using the bridge priority and the base MAC address of the bridge.
Time Since Topology Change: Time in seconds.
Topology Change Count: Number of times changed.
Topology Change: Boolean value of the Topology Change parameter for the switch indicating if a topology change is in progress on any port assigned to the common and internal spanning tree.
Designated Root: The bridge identifier of the root bridge. It is made up from the bridge priority and the base MAC address of the bridge.
Root Path Cost: Value of the Root Path Cost parameter for the common and internal spanning tree.
Root Port Identifier: Identifier of the port to access the Designated Root for the CST.
Root Port Max Age: Derived value.
Root Port Bridge Forward Delay: Derived value.
Hello Time: Configured value of the parameter for the CST.
Bridge Hold Time: Minimum time between transmission of Configuration Bridge Protocol Data Units (BPDUs)
Bridge Max Hops: Bridge max-hops count for the device.
CST Regional Root: Bridge Identifier of the CST Regional Root. It is made up using the bridge priority and the base MAC address of the bridge.
Regional Root Path Cost: Path Cost to the CST Regional Root.
Associated FIDs: List of forwarding database identifiers currently associated with this instance.
Associated VLANs: List of VLAN IDs currently associated with this instance.
show spanning-tree brief
This command displays spanning tree settings for the bridge. The following information appears.
Format: show spanning-tree brief
Modes: Privileged EXEC, User EXEC
The display parameters for above command are:
Bridge Priority: Configured value.
Bridge Identifier: The bridge identifier for the selected MST instance. It is made up using the bridge priority and the base MAC address of the bridge.
Bridge Max Age: Configured value.
Bridge Max Hops: Bridge max-hops count for the device.
Bridge Hello Time: Configured value.
Bridge Forward Delay: Configured value.
Bridge Hold Time: Minimum time between transmission of Configuration Bridge Protocol Data Units (BPDUs)
show spanning-tree interface
This command displays the settings and parameters for a specific switch port within the common and internal spanning tree. The <unit/slot/port> is the desired switch port. The following details are displayed on execution of the command.
Format: show spanning-tree interface <unit/slot/port>
Modes:
Privileged EXEC
User EXEC
The display parameters for above command are:
Hello Time: Admin hello time for this port.
Port mode: Enabled or disabled.
Port Up Time Since Counters Last Cleared: Time since port was reset, displayed in days, hours, minutes, and seconds.
STP BPDUs: Transmitted Spanning Tree Protocol Bridge Protocol Data Units sent
STP BPDUs: Received Spanning Tree Protocol Bridge Protocol Data Units received.
RST BPDUs: Transmitted Rapid Spanning Tree Protocol Bridge Protocol Data Units sent
RST BPDUs: Received Rapid Spanning Tree Protocol Bridge Protocol Data Units received.
MSTP BPDUs: Transmitted Multiple Spanning Tree Protocol Bridge Protocol Data Units sent
MSTP BPDUs: Received Multiple Spanning Tree Protocol Bridge Protocol Data Units received.
show spanning-tree mst port detailed
This command displays the detailed settings and parameters for a specific switch port within a particular multiple spanning tree instance. The parameter <mstid> is a number that corresponds to the desired existing multiple spanning tree instance. The <unit/slot/port> is the desired switch port.
Format: show spanning-tree mst port detailed <mstid> <unit/slot/port>
Mode:
Privileged EXEC
User EXEC
The display parameters for above command are:
MST Instance ID: The ID of the existing MST instance.
Port Identifier: The port identifier for the specified port within the selected MST instance. It is made up from the port priority and the interface number of the port.
Port Priority: The priority for a particular port within the selected MST instance. The port priority is displayed in multiples of 16.
Port Forwarding State: Current spanning tree state of this port.
Port Role: Each enabled MST Bridge Port receives a Port Role for each spanning tree. The port role is one of the following values: Root Port, Designated Port,Alternate Port, Backup Port, Master Port or Disabled Port
Auto-Calculate Port Path Cost: Indicates whether auto calculation for port path cost is enabled.
Port Path Cost: Configured value of the Internal Port Path Cost parameter.
Designated Root: The Identifier of the designated root for this port.
Root Path Cost: The path cost to get to the root bridge for this instance. The root path cost is zero if the bridge is the root bridge for that instance.
Designated Bridge: Bridge Identifier of the bridge with the Designated Port.
Designated Port Identifier:Port on the Designated Bridge that offers the lowest cost to the LAN.
Loop Inconsistent State: The current loop inconsistent state of this port in this MST instance. When in loop inconsistent state, the port has failed to receive BPDUs while configured with loop guard enabled. Loop inconsistent state maintains the port in a blocking state until a subsequent BPDU is received.
Transitions Into Loop Inconsistent State: The number of times this interface has transitioned into loop inconsistent state.
Transitions Out of Loop Inconsistent State: The number of times this interface has transitioned out of loop inconsistent state.
If you specify 0 (defined as the default CIST ID) as the <mstid>, this command displays the settings and parameters for a specific switch port within the common and internal spanning tree. The <unit/slot/port> is the desired switch port. In this case, the following are displayed.
Port Identifier: The port identifier for this port within the CST.
Port Priority: The priority of the port within the CST.
Port Forwarding State: The forwarding state of the port within the CST.
Port Role: The role of the specified interface within the CST.
Auto-Calculate Port Path Cost: Indicates whether auto calculation for port path cost is enabled or not (disabled).
Port Path Cost: The configured path cost for the specified interface.
Auto-Calculate External Port Path Cost: Indicates whether auto calculation for external port path cost is enabled.
External Port Path Cost: The cost to get to the root bridge of the CIST across the boundary of the region. This means that if the port is a boundary port for an MSTP region, then the external path cost is used.
Designated Root: Identifier of the designated root for this port within the CST.
Root Path Cost: The root path cost to the LAN by the port.
Designated Bridge: The bridge containing the designated port
Designated Port Identifier: Port on the Designated Bridge that offers the lowest cost to the LAN
Topology Change Acknowledgement: Value of flag in next Configuration Bridge Protocol Data Unit (BPDU) transmission indicating if a topology change is in progress for this port.
Hello Time: The hello time in use for this port.
Edge Port: The configured value indicating if this port is an edge port.
Edge Port Status: The derived value of the edge port status. True if operating as an edge port; false otherwise.
Point To Point MAC Status: Derived value indicating if this port is part of a point to point link.
CST Regional Root: The regional root identifier in use for this port.
CST Internal Root Path Cost: The internal root path cost to the LAN by the designated external port.
Loop Inconsistent State: The current loop inconsistent state of this port in this MST instance. When in loop inconsistent state, the port has failed to receive BPDUs while configured with loop guard enabled. Loop inconsistent state maintains the port in a blocking state until a subsequent BPDU is received.
Transitions Into Loop Inconsistent State: The number of times this interface has transitioned into loop inconsistent state.
Transitions Out of Loop Inconsistent State: The number of times this interface has transitioned out of loop inconsistent state.
show spanning-tree mst port summary
This command displays the settings of one or all ports within the specified multiple spanning tree instance. The parameter <mstid> indicates a particular MST instance. The parameter {<unit/slot/port> | all} indicates the desired switch port or all ports.
If you specify 0 (defined as the default CIST ID) as the <mstid>, the status summary displays for one or all ports within the common and internal spanning tree.
Format: show spanning-tree mst port summary <mstid> {<unit/slot/port> | all}
Modes:
Privileged EXEC
User EXEC
The display parameters for above command are:
MST Instance ID: The MST instance associated with this port.
Interface: Valid slot and port number separated by a forward slash.
Type: Currently not used.
STP State: The forwarding state of the port in the specified spanning tree instance
Port Role: The role of the specified port within the spanning tree.
Desc: Indicates whether the port is in loop inconsistent state or not. This field is blank if the loop guard feature is not available.
show spanning-tree mst port summary active
This command displays settings for the ports within the specified multiple spanning tree instance that are active links.
Format: show spanning-tree mst port summary mstid active
Mode:
Privileged EXEC
User EXEC
The display parameters for above command are:
MST Instance ID: The ID of the existing MST instance.
Interface:<unit/slot/port>
STP Mode: Indicates whether spanning tree is enabled or disabled on the port.
Type: Currently not used.
STP State: The forwarding state of the port in the specified spanning tree instance.
Port Role: The role of the specified port within the spanning tree.
Desc: Indicates whether the port is in loop inconsistent state or not. This field is blank if the loop guard feature is not available.
show spanning-tree mst summary
This command displays summary information about all multiple spanning tree instances in the switch. On execution, the following details are displayed.
Format: show spanning-tree mst summary
Modes: Privileged EXEC and User EXEC
The display parameters for above command are:
MST Instance ID: List List of multiple spanning tree ID currently configured in the switch.
MST Bridge Priority: Specifies the local bridge priority for the Multiple Spanning Tree (MST). The value lies between 0 and 61440. It is displayed in multiples of 4096.
MST Bridge Identifier: The local bridge identifier for the MST. It is made up using the bridge priority and the base MAC address of the bridge.
Designated Root: The bridge identifier of the root bridge. It is made up from the bridge priority and the base MAC address of the bridge.
Designated Root Priority: Specifies the root bridge priority for the Multiple Spanning Tree (MST). The value lies between 0 and 61440. It is displayed in multiples of 4096.
Root Path Cost: Value of the Root Path Cost parameter for the common and internal spanning tree.
Root Port Identifier: Identifier of the port to access the Designated Root for the CST.
For each MSTID - Associated VLANs: List of VLAN IDs associated with this instance.
Interface: unit/slot/port
STP Mode: Indicates whether spanning tree is enabled or disabled on the port.
Type: Currently not used.
STP State: The forwarding state of the port in the specified spanning tree instance.
Port Role: The role of the specified port within the spanning tree.
Desc: Indicates whether the port is in loop inconsistent state or not. This field is blank if the loop guard feature is not available.
show spanning-tree summary
This command displays spanning tree settings and parameters for the switch. The following details are displayed on execution of the command.
Format: show spanning-tree summary
Modes: Privileged EXEC and User EXEC
The display parameters for above command are:
Spanning Tree Adminmode: Enabled or disabled.
Spanning Tree Version: Version of 802.1 currently supported (IEEE 802.1s, IEEE 802.1w, or IEEE 802.1d) based upon the Force Protocol Version parameter.
BPDU Guard Mode: Enabled or disabled.
BPDU Filter Mode: Enabled or disabled.
Configuration Name: Identifier used to identify the configuration currently being used.
Configuration Revision Level: Identifier used to identify the configuration currently being used.
Configuration Digest Key: Identifier used to identify the configuration currently being used.
Configuration Format Selector: Specifies the version of the configuration format being used in the exchange of BPDUs. The default value is zero.
MST Instances: Instances List of all multiple spanning tree instances configured on the switch
show spanning-tree vlan
This command displays the association between a VLAN and a multiple spanning tree instance. The <vlanid> corresponds to an existing VLAN ID.
Format: show spanning-tree vlan <vlanid>
Modes:
Privileged EXEC
User EXEC
The display parameters for above command are:
VLAN Identifier: The VLANs associated with the selected MST instance.
Associated Instance: Identifier for the associated multiple spanning tree instance or “CST” if associated with the common and internal spanning tree.