|
Global Configuration - |
Interface Configuration - |
Privileged Exec -
|
These commands are used to configure STP for the overall switch, or to configure STP for the selected interface.
Use this command to enable the Spanning Tree Protocol globally for the switch. Use the no form to disable it.
Syntax
spanning-tree
no spanning-tree
Default Setting
Spanning Tree is enabled.
Command Mode
Global Configuration
Command Usage
The Spanning Tree Protocol can be used to detect and disable network loops, and to provide backup links between switches, bridges or routers. This allows the switch to interact with other bridging devices (that is, an STP-compliant switch, bridge or router) in your network to ensure that only one route exists between any two stations on the network, and provide backup links which automatically take over when a primary link goes down.
Example
The following example shows how to enable the Spanning Tree Protocol for the switch:
Console(config)#spanning-tree
Console(config)#
Use this command to select the Spanning Tree mode for the switch. Use the no form to restore the default.
Syntax
spanning-tree mode {stp | rstp}
no spanning-tree mode
- stp - Spanning Tree Protocol (IEEE 802.1D)
- rstp - Rapid Spanning Tree (IEEE 802.1w)
Default Setting
rstp
Command Mode
Global Configuration
Command Usage
Example
The following example configures the switch to use Rapid Spanning Tree.
Console(config)#spanning-tree mode rstp
Console(config)#
Use this command to configure the Spanning Tree bridge forward time globally for the switch. Use the no form to restore the default.
Syntax
spanning-tree forward-time seconds
no spanning-tree forward-time
seconds - Time in seconds. (Range: 4 - 30 seconds)
The minimum value is the higher of 4 or [(max-age / 2) + 1].
Default Setting
15 seconds
Command Mode
Global Configuration
Command Usage
This command sets the maximum time (in seconds) the root device will wait before changing states (i.e., listening to learning to forwarding). This delay is required because every device must receive information about topology changes before it starts to forward frames. In addition, each port needs time to listen for conflicting information that would make it return to a discarding state; otherwise, temporary data loops might result.
Example
Console(config)#spanning-tree forward-time 20
Console(config)#
Use this command to configure the Spanning Tree bridge hello time globally for the switch. Use the no form to restore the default.
Syntax
spanning-tree hello-time time
no spanning-tree hello-time
time - Time in seconds. (Range: 1 - 10 seconds)
The maximum value is the lower of 10 or [(max-age / 2) -1].
Default Setting
2 seconds
Command Mode
Global Configuration
Command Usage
This command sets the time interval (in seconds) at which the root device transmits a configuration message.
Example
Console(config)#spanning-tree hello-time 5
Console(config)#
Use this command to configure the Spanning Ttree bridge maximum age globally for the switch. Use the no form to restore the default.
Syntax
spanning-tree max-age seconds
no spanning-tree max-age
seconds - Time in seconds. (Range: 6-40 seconds)
The minimum value is the higher of 6 or [2 x (hello-time + 1)].
The maximum value is the lower of 40 or [2 x (forward-time - 1)].
Default Setting
20 seconds
Command Mode
Global Configuration
Command Usage
This command sets the maximum time (in seconds) a device can wait without receiving a configuration message before attempting to reconfigure. All device ports (except for designated ports) should receive configuration messages at regular intervals. Any port that ages out STP information (provided in the last configuration message) becomes the designated port for the attached LAN. If it is a root port, a new root port is selected from among the device ports attached to the network.
Example
Console(config)#spanning-tree max-age 40
Console(config)#
Use this command to configure the spanning tree priority globally for this switch. Use the no form to restore the default.
Syntax
spanning-tree priority priority
no spanning-tree priority
priority - Priority of the bridge.
(Range 0-61440, in steps of 4096; Options: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440)
Default Setting
32768
Command Mode
Global Configuration
Command Usage
Bridge priority is used in selecting the root device, root port, and designated port. The device with the highest priority becomes the STP root device. However, if all devices have the same priority, the device with the lowest MAC address will then become the root device.
Example
Console(config)#spanning-tree priority 40000
Console(config)#
Use this command to configure the path cost method used for the Rapid Spanning
Tree. Use the no form to restore the default.
Syntax
spanning-tree pathcost method {long | short}
no spanning-tree pathcost method
- long - Specifies 32-bit based values that range from 1-200,000,000.
- short - Specifies 16-bit based values that range from 1-65535.
Default Setting
short method
Command Mode
Global Configuration
Command Usage
The path cost method is used to determine the best path between devices. Therefore, lower values should be assigned to ports attached to faster media, and higher values assigned to ports with slower media. Note that path cost takes precedence over port priority.
Example
Console(config)#spanning-tree pathcost method long
Console(config)#
Use this command to configure the minimum interval between the transmission
of consecutive RSTP BPDUs. Use the no form to restore the default.
Syntax
spanning-tree transmission-limit count
no spanning-tree transmission-limitcount - The transmission limit in seconds. (Range: 1-10)
Default Setting
3
Command Mode
Global Configuration
Command Usage
This command limit the maximum transmission rate for BPDUs.
Example
Console(config)#spanning-tree transmission-limit 4
Console(config)#
Use this command to configure the spanning tree path cost for the specified interface. Use the no form to restore the default.
Syntax
spanning-tree cost cost
no spanning-tree cost
- cost - The path cost for the interface.
(Range - 1-200,000,000)
The recommended range is -
- Ethernet: 200,000-20,000,000
- Fast Ethernet: 20,000-2,000,000
- Gigabit Ethernet: 2,000-200,000
Default Setting
Command Mode
Interface Configuration (Ethernet, Port Channel)
Command Usage
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree cost 50
Console(config-if)#
Related Commands
Use this command to configure the priority for the specified interface. Use the no form to restore the default.
Syntax
spanning-tree port-priority priority
no spanning-tree port-prioritypriority - The priority for an interface. (Range: 0-240, in steps of 16)
Default Setting
128
Command Mode
Interface Configuration (Ethernet, Port Channel)
Command Usage
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree port-priority 0
Console(config-if)#
Related Commands
Use this command to set an interface to fast forwarding. Use the no form to disable fast forwarding.
Syntax
spanning-tree portfast
no spanning-tree portfast
Default Setting
Disabled
Command Mode
Interface Configuration (Ethernet, Port Channel)
Command Usage
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree portfast
Console(config-if)#
Related Commands
Use this command to specify an interface as an edge port. Use the no form to restore the default.
Syntax
spanning-tree edge-port
no spanning-tree edge-port
Default Setting
Disabled
Command Mode
Interface Configuration (Ethernet, Port Channel)
Command Usage
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree edge-port
Console(config-if)#
Related Commands
Use this command to configure the link type for the Rapid Spanning Tree. Use
the no form to restore the default.
Syntax
spanning-tree link-type {auto | point-to-point | shared}
no spanning-tree link-type
- auto - Automatically derived from the duplex mode setting.
- point-to-point - Point-to-point link.
- shared - Shared medium.
Default Setting
auto
Command Mode
Interface Configuration (Ethernet, Port Channel)
Command Usage
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree link-type point-to-point
Console(config-if)#
Use this command to re-check the appropriate BPDU format to send on the selected
interface.
Syntax
spanning-tree protocol-migration interface
interface
- ethernet unit/port-number
- unit - This is device 1.
- port-number
- port-channel channel-id (Range: 1-6)
Command Mode
Privileged Exec
Command Usage
If at any time the switch detects STP BPDUs, including Configuration or Topology Change Notification BPDUs, it will automatically set the selected interface to forced STP-compatible mode. However, you can also use the spanning-tree protocol-migration command at any time to manually re-check the appropriate BPDU format to send on the selected interfaces (i.e., RSTP or STP-compatible).
Example
Console(config)#interface ethernet 1/5
Console(config-if)#spanning-tree protocol-migration
Console(config-if)#
Use this command to show the Spanning Tree configuration.
Syntax
show spanning-tree [interface]
interface
- ethernet unit/port-number
- unit - This is device 1.
- port-number - Port number.
- port-channel channel-id (Range: 1-6)
Default Setting
None
Command Mode
Privileged Exec
Command Usage
Example
Console#show spanning-tree
Spanning-tree information
---------------------------------------------------------------
Spanning tree mode :RSTP
Spanning tree enable/disable :enable
Priority :32768
Bridge Hello Time (sec.) :2
Bridge Max Age (sec.) :20
Bridge Forward Delay (sec.) :15
Root Hello Time (sec.) :2
Root Max Age (sec.) :20
Root Forward Delay (sec.) :15
Designated Root :32768.000011112222
Current root port :0
Current root cost :0
Number of topology changes :1
Last topology changes time (sec.):25067
Transmission limit :3
Path Cost Method :long
---------------------------------------------------------------
Eth 1/ 1 information
---------------------------------------------------------------
Admin status : enable
Role : disable
State : discarding
Path cost : 10000
Priority : 128
Designated cost : 0
Designated port : 128.1
Designated root : 32768.000011112222
Designated bridge : 32768.000011112222
Fast forwarding : disable
Forward transitions : 0
Admin edge port : disable
Oper edge port : disable
Admin Link type : auto
Oper Link type : point-to-point
.
.
.
Console#
Please read all restrictions and disclaimers.