Use the spanning-tree global configuration command to enable spanning tree functionality. To disable spanning tree functionality, use the no form of this command.
Syntax
spanning-tree
no spanning-tree
Default Configuration
Spanning tree is enabled.
Command Modes
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Example
The following example enables spanning tree functionality.
Console(config)# spanning-tree
spanning-tree mode
Use the spanning-tree mode global configuration command to configure the spanning tree protocol currently running. To return to the default configuration, use the no form of this command.
Syntax
spanning-tree mode {stp | rstp}
no spanning-tree mode
stpRSTP is not supported
rstpRSTP is supported
Default Configuration
spanning tree protocol is supported (stp).
Command Modes
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Example
The following example configures the spanning tree protocol to RSTP.
Console(config)# spanning-tree mode rstp
spanning-tree forward-time
Use the spanning-tree forward-time global configuration 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.
To reset the default forward time, use the no form of this command.
Syntax
spanning-tree forward-time seconds
no spanning-tree forward-time
secondsTime in seconds (Range: 4-30).
Default Configuration
The default forwarding-time for IEEE Spanning Tree Protocol (STP) is 15 seconds.
Command Modes
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Example
The following example configures spanning tree bridge forward time.
Console(config)# spanning-tree forward-time 25
spanning-tree hello-time
Use the spanning-tree hello-time global configuration command to configure the spanning tree bridge hello time, which is how often the switch broadcasts hello messages to other switches only if it is the root bridge. To reset the default hello time, use the no form of this command.
Syntax
spanning-tree hello-time seconds
no spanning-tree hello-time
secondsTime in seconds (Range: 1-10).
Default Configuration
The default hello time for IEEE Spanning Tree Protocol (STP) is 2 seconds.
Command Modes
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Example
The following example configures spanning tree bridge hello time.
Console(config)# spanning-tree hello-time 5
spanning-tree max-age
Use the spanning-tree max-age global configuration command to configure the spanning tree bridge maximum age. To reset the default maximum age, use the no form of this command.
Syntax
spanning-tree max-age seconds
no spanning-tree max-age
seconds -Time in seconds (Range: 6-40).
Default Configuration
The default max-age for IEEE STP is 20 seconds.
Command Modes
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Example
The following example configures the spanning tree bridge maximum-age.
Console(config)# spanning-tree max-age 10
spanning-tree priority
Use the spanning-tree priority global configuration command to configure the spanning tree priority. The priority value is used to determine which bridge is elected as the root bridge. To reset the default spanning tree priority, use the no form of this command.
Syntax
spanning-tree priority priority
no spanning-tree priority
priorityPriority of the bridge (Range: 0-61440 in steps of 4096).
Default Configuration
The default STP bridge priority according to IEEE 802.10 is 32768.
Command Modes
Global Configuration Mode
User Guidelines
The lower the priority, the more likely the bridge is to be elected as the root bridge.
Example
The following example configures spanning tree priority.
Console(config)# spanning-tree priority 12288
spanning-tree disable
Use the spanning-tree disable interface configuration command to disable spanning tree on a specific port. To enable spanning tree on a port, use the no form of this command.
Syntax
spanning-tree disable
no spanning-tree disable
Default Configuration
By default, all ports are enabled for spanning tree.
The following example disables the spanning tree on port 1/e5.
Console(config)# interface ethernet 1/e5
Console(config-if)# spanning-tree disable
spanning-tree cost
Use the spanning-tree cost interface configuration command to configure the spanning tree path cost for a port. To reset the default port path cost, use the no form of this command.
The following example configures spanning tree cost on port 1/e5 to 35000.
Console(config)# interface ethernet 1/e5
Console(config-if)# spanning-tree cost 35000
spanning-tree port-priority
Use the spanning-tree port-priority interface configuration command to configure port priority. To reset the default port priority, use the no form of this command.
Syntax
spanning-tree port-priority priority
no spanning-tree port-priority
priorityThe port priority (Range: 0-240 in steps of 16).
Default Configuration
The default port-priority for IEEE 802.10 (STP) is 128.
Use the spanning-tree portfast interface configuration command to enable PortFast Mode. In PortFast Mode, the interface is immediately put into the forwarding state upon linkup, without waiting for the timer to expire. To disable PortFast Mode, use the no form of this command. This command when in rstp mode sets port to an edgeport.
This feature should be used only with interfaces connected to end stations. Otherwise, an accidental topology loop could cause a data packet loop and disrupt switch and network operations.
Example
The following example enables PortFast Mode on port 1/e5.
Console(config)# interface ethernet 1/e5
Console(config-if)# spanning-tree portfast
clear spanning-tree detected-protocols
Use the clear spanning-tree detected-protocols privileged EXEC command to restart the protocol migration process (force the renegotiation with neighboring switches) on all interfaces or on the specified interface.
Use the spanning-tree link-type interface configuration command to override the default link-type setting. To reset the default, use the no form of this command.
Syntax
spanning-tree link-type {point-to-point | shared}
no spanning-tree spanning-tree link-type
point-to-pointSpecify the port link type as point-to-point.
sharedSpecify that the port link type is shared.
Default Configuration
The switch derives the link type of a port 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.