Spanning Tree Protocol Commands
Use these M4500 CLI commands to configure STP, RSTP, and MSTP bridge and port settings, BPDU guard and filtering, and display spanning tree status.
This section describes the commands you use to configure Spanning Tree Protocol (STP). STP helps prevent network loops, duplicate messages, and network instability.
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 |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| 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 in progress | 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. |
| Parameter | Definition |
| Root Port Identifier | Identifier of the port to access the Designated Root for the CST |
| Bridge Max Age | Maximum message age. |
| Bridge Max Hops | The maximum number of hops for the spanning tree. |
| Max Tx Hold Count | The max value of bridge tx hold count for the spanning tree. |
| Bridge Forwarding Delay | A timeout value to be used by all Bridges in the Bridged LAN. The value of Forward Delay is set by the Root. |
| Hello Time | Configured value of the parameter for the CST. |
| Bridge Hold Time | Minimum time between transmission of Configuration Bridge Protocol Data Units (BPDUs). |
| 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. |
show spanning-tree interface
This command displays the settings and parameters for a specific switch port within the common and internal spanning tree. The <slot/port> is the desired switch port. The following details are displayed on execution of the command.
| Format | show spanning-tree interface {<slot/port> | port-channel <portchannel-id>} |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| Hello Time | Admin hello time for this port. |
| Port Mode | Enabled or disabled. |
| BPDU Guard | Enabled or disabled BPDU Guard |
| BPDU Guard Effect | The effect of BPDU Guard when the BPDU Guard is enabled |
| Root Guard | Enabled or disabled Root Guard |
| Loop Guard | Enabled or disabled Loop Guard |
| TCN Guard | Enabled or disabled TCN Guard |
| Auto Edge | Enabled or disabled the feature that causes a port that has not seen a BPDU for edge delay time, to become an edge port and transition to forwarding faster. |
| 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. |
| RSTP BPDUs Transmitted | Rapid Spanning Tree Protocol Bridge Protocol Data Units sent. |
| RSTP 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 vlan
This command displays the association between a VLAN and a multiple tree instance. The <vlan-id> corresponds to an existing VLAN ID. The <vlan-id> range is 1 to 4093.
| Default | None |
| Format | show spanning-tree vlan <vlan-id> |
| Mode |
Privileged EXEC User EXEC |
Example: The following example shows the CLI display output for the command show spanning-tree vlan1.
M4500-32C) #show spanning-tree vlan 1
VLAN Identifier................................ 1
Associated Instance............................ CST
show spanning-tree mst detailed
This command displays the detailed settings for an MST instance. The instance <0-4094> is a number that corresponds to the desired existing multiple spanning tree instance ID. The following details are displayed.
| Format | show spanning-tree mst detailed <mstid> |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| MST Instance ID | The multiple spanning tree instance ID. |
| MST Bridge Priority | The bridge priority of current MST. |
| MST Bridge Identifier | The bridge ID of current MST. |
| Time Since Topology Change | In seconds. |
| Topology Change Count | Number of times the topology has changed for this multiple spanning tree instance. |
| Topology Change in progress | Value of the Topology Change parameter for the multiple spanning tree instance. |
| Designated Root | Identifier of the Regional Root for this multiple spanning tree instance. |
| Root Path Cost | Path Cost to the Designated Root for this multiple spanning tree instance. |
| Root Port Identifier | Port to access the Designated Root for this multiple spanning tree instance. |
| Associated FIDs | List of forwarding database identifiers associated with this instance. |
| Associated VLANs | List of VLAN IDs associated with this instance. |
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 |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| MST Instance ID List | List of multiple spanning trees IDs currently configured. |
| For each MSTID: | List of forwarding database identifiers associated with this instance. |
|
Associated FIDs Associated VLANs |
List of VLAN IDs associated with this instance. |
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 <slot/port> is the desired switch port.
| Format | show spanning-tree mst port detailed <mstid> {<slot/port> | port-channel <portchannel-id>} |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| 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. |
| Designated Port Cost | Path Cost offered to the LAN by the Designated Port. |
| 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. |
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 slot/port is the desired switch port. In this case, the following are displayed.
| Parameter | Definition |
|---|---|
| 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. |
| Designated Port Cost | Path Cost offered to the LAN by the Designated 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 MSTP loop inconsistent state of the port in a specific instance. |
| Transitions Into Loop Inconsistent State | The number of times this interface has transitioned into the MSTP loop inconsistent state. |
| Transitions Out Of Loop Inconsistent State | The number of times this interface has transitioned out of the MSTP 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 <misted> range is 0 to 4096. The parameter <slot/port> indicates the desired switch port.
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> [{<slot/port> | active | port-channel <portchannel-id>}] |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| MST Instance ID | The MST instance associated with this port. |
| Interface | 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. |
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 |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| Spanning Tree Admin mode | Enabled or disabled. |
| Spanning Tree Forward BPDU | 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. |
| 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 | A generated Key used in the exchange of the BPDUs. |
| Configuration Format Selector | Specifies the version of the configuration format being used in the exchange of BPDUs. The default value is zero. |
| MST Instances | List of all multiple spanning tree instances configured on the switch. |
show spanning-tree brief
This command displays spanning tree settings for the bridge. The following information appears.
| Format | show spanning-tree brief |
| Mode |
Privileged EXEC User EXEC |
Display Message
| Parameter | Definition |
|---|---|
| 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). |
spanning-tree
This command sets the spanning-tree operational mode to enabled.
| Default | Enabled |
| 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 bpdu-forwarding
This command sets the BPDU forwarding mode.
| Default | Enabled |
| Format | spanning-tree bpdu-forwarding |
| Mode | Global Config |
no spanning-tree bpdu-forwarding
This command sets the BPDU forwarding mode to disabled.
| Format | no spanning-tree bpdu-forwarding |
| Mode | Global Config |
spanning-tree protocol-migration
This command enables BPDU migration check on a given interface. The all option enables BPDU migration check on all interfaces.
| Default | None |
| Format | spanning-tree protocol-migration {<slot/port> | port-channel <portchannel-id> | all} |
| Mode | Global Config |
spanning-tree configuration name
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 sets the Configuration Identifier Name to “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.
| Default | 0 |
| Format | spanning-tree configuration revision <0-65535> |
| Mode | Global Config |
no spanning-tree configuration revision
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 mode
This command configures global spanning tree mode per VLAN spanning tree. On a switch, only one mode can be enabled at a time.
| Default | mstp |
| Format | spanning-tree mode {mstp | rstp} |
| Mode | Global Config |
no spanning-tree mode
This command globally configures the switch to the default spanning-tree mode, MSTP.
| Format | no spanning-tree mode |
| 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 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 times (Bridge Forward Delay - 1)” and greater than or equal to “2 times (Bridge Hello Time + 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 forward-time max-age
This command sets the Bridge Forward Delay and Max Age parameter to a new value for the common and internal spanning tree.
| Default |
forward-time: 15 max-age: 20 |
| Format | spanning-tree forward-time <4-30> max-age <6-40> |
| 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 6 to 40.
| Default | 20 |
| Format | spanning-tree max-hops <6-40> |
| 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 hold-count
This command sets the Bridge Tx Hold Count parameter to a new value for the common and internal spanning tree. The Tx Hold Count value is in a range of 1 to 10.
| Default | 6 |
| Format | spanning-tree hold-count <1-10> |
| Mode | Global Config |
no spanning-tree hold-count
This command sets the Bridge Tx Hold Count parameter for the common and internal spanning tree to the default value.
| Format | no spanning-tree hold-count |
| Mode | Global Config |
spanning-tree mst instance
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 <0-4094> 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.
| Default | 32768 |
| Format | spanning-tree mst priority <mstid> <0-61440> |
| Mode | Global Config |
no spanning-tree mst priority
This command sets the bridge priority for a specific multiple spanning tree instance to the default value. The parameter mstid <0-4094> 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 | no spanning-tree mst priority <mstid> |
| Mode | Global Config |
spanning-tree mst vlan
This command adds an association between a multiple spanning tree instance and one or more VLANs so that the VLAN(s) are no longer associated with the common and internal spanning tree. The parameter mstid <0-4094> is a number that corresponds to the desired existing multiple spanning tree instance. The vlan-list can be specified as a single VLAN, a list, or a range of values. To specify a list of VLANs, enter a list of VLAN IDs, each separated by a comma with no spaces in between. To specify a range of VLANs, separate the beginning and ending VLAN ID with a dash (-). The VLAN IDs may or may not exist in the system.
| Format | spanning-tree mst vlan <mstid> <vlan-list> |
| Mode | Global Config |
no spanning-tree mst vlan
This command removes an association between a multiple spanning tree instance and one or more VLANs so that the VLAN(s) are again associated with the common and internal spanning tree.
| Format | no spanning-tree mst vlan <mstid> <vlan-list> |
| 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 <0-4094> 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.
| Default |
cost: auto port-priority: 128 |
| Format | spanning-tree mst <mstid> {{cost <1-200000000> | auto} | port-priority <0-240>} |
| Mode | Interface Config |
no 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 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 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 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 | port-priority} |
| Mode | Interface Config |
spanning-tree port mode
This command sets the Administrative Switch Port State for this port to enabled.
| Default | Enabled |
| 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 model all
This command sets the Administrative Switch Port State for all ports to enabled.
| Default | Enabled |
| 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 |
spaning-tree auot-edge
Use this command to allow the interface to become an edge port if it does not receive any BPDUs within a given amount of time.
| Default | Enabled |
| Format | spanning-tree auto-edge |
| Mode | Interface Config |
no spanning-tree auto-edge
This command resets the auto-edge status of the port to the default value.
| Format | no spanning-tree auto-edge |
| Mode | Interface Config |
spanning-tree cost
Use this command to configure the external path cost for port used by a MST instance. When the auto keyword is used, the path cost from the port to the root bridge is automatically determined by the speed of the interface. To configure the cost manually, specify a cost value from 1 – 200000000.
| Default | Auto |
| Format | spanning-tree cost {<cost> | auto} |
| Mode | Interface Config |
no spanning-tree cost
This command resets the path cost to the default value.
| Format | no spanning-tree cost |
| Mode | Interface Config |
spanning-tree edgeport
This command specifies that an interface 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 edgeport bpduguard
This command sets the Edgeport BPDU Guard enable/disable parameter on this switch.
| Default | Disabled |
| Format | spanning-tree edgeport bpduguard |
| Mode | Global Config |
no spanning-tree edgeport bpduguard
This command sets the Edgeport BPDU Guard to the default value that is disabled.
| Format | no spanning-tree edgeport bpduguard |
| Mode | Global Config |
spanning-tree bpduguard
Use this command to enable BPDU Guard on an interface.
| Default | Disabled |
| Format | spanning-tree bpduguard |
| Mode | Interface Config |
no spanning-tree bpduguard
Use this command to disable BPDU Guard on the interface.
| Format | no spanning-tree bpduguard |
| Mode | Interface Config |
spanning-tree guard
Use this command to select whether loop guard or root guard is enabled on an interface or range of interfaces.
| Default | Disabled |
| Format | spanning-tree guard {loop | root} |
| Mode | Interface Config |
| Parameter | Definition |
|---|---|
| loop | This command sets the Guard Mode to loop guard on this interface. |
| root | This command sets the Guard Mode to root guard on this interface. |
no spanning-tree guard
Use this command to disable loop guard or root guard on the interface.
| Format | no spanning-tree guard |
| Mode | Interface Config |
spanning-tree tcnguard
Use this command to enable TCN guard on the interface. When enabled, TCN guard restricts the interface from propagating any topology change information received through that interface.
| Default | Enabled |
| Format | spanning-tree tcnguard |
| Mode | Interface Config |
no spanning-tree tcnguard
Use this command to reset the TCN guard status of the port to the default value.
| Format | no spanning-tree tcnguard |
| Mode | Interface Config |