spanning-tree

To enable and define spanning tree operation, use the spanning-tree command in Global Configuration Mode. Spanning tree operation provides path redundancy while preventing undesirable loops in the network that are created by multiple active paths between stations. It logically breaks such loops and prevents looping traffic from clogging the network. The no form of this command disables the spanning tree operation in the switch and resets the spanning tree related information to its default values. The spanning tree operation is automatically enabled in the switch, once the spanning tree Mode is changed.The default spanning tree algorithm is rapid spanning tree. Note that the spanning tree operation can be enabled in the switch only if the spanning tree functionality has not been shut down in the switch.

spanning-tree

spanning-tree { [compatibility } { {stp | } { rst | } { mst}] }
{ [flush-indication-threshold } { <value (0-65535)>] }
{ [flush-interval } { <centi-seconds (0-500)>] } { [forward-time } { <seconds(4-30)>] }
{ [forwarddelay } optimization alternate-role { {disabled | } { enabled}] }
{ [hello-time } { <seconds(0-20)>] } { [max-age } { <seconds (6-40)>] }
{ [mode } { {mst | } { pvrst| } { pvst| } { rapid-pvst| } { rst}] }
{ [mst } { {<instance ID } { <instance ID (1-64> } { {primary } { | secondary} } { {priority } { <value (0-61440)> } { | flush-indication-threshold } { <value (0-65535)>} } { | configuration } { | forward-time } { <seconds(4-30> } { | hello-time } { <seconds(0-2)> | } { instance-id } { <(1-64)>| } { max-age } { <seconds (6-40)> } { | max-hops } { <(6-40)> } { | max-instance | } { <(1-64>}] }
{ [pathcost dynamic } { [lag-speed]] } { [portfast bpduguard default] } { [priority } { <value (0-61440)>] } { [transmit } { hold-count } { <value (0-61440)>] }
{ [vlan } { <vlan-id/vfi_id> } { {brg-priority } { <integer(0-61440)> } { | forward-time } { <seconds(4-30)> } { | hello-time } { <seconds(0-2)> } { | hold-count } { <value (1-10)> } { | max-age } { <seconds (6-40)> } { | brg-priority } { <integer(0-61440)> } { | root } { {primary | } { secondary}] }

no spanning-tree

spanning-tree { {compatibility | } { flush-indication-threshold| } { flush-interval } { | forward-time | } { forwarddelay | } { hello-time | } { max-age | } { mode | } { mst | } { pathcost | } { portfast | } { priority | } { transmit | } { vlan} }

Parameters

Parameter Type Description
compatibility   Enter to set the STP compatibility version in the switch for all ports.
stp   Enter to configure Spanning Tree Protocol configuration.
rst   Enter to configure Rapid Spanning Tree configuration.
mst   Enter to configure Multiple Spanning Tree configuration.
flush-indication-threshold   Enter to configure the flush indication threshold value for a specific instance. When flush indication threshold is default value and flush interval is non-default value, instance based flushing occurs during the first flush indication trigger. When the flush indication threshold value is non-default (x) and flush-interval value is non-default, port & instance based flushing is triggered until the threshold (x) is reached. Once the threshold is reached, instance based flushing is triggered & timer starts.
<value (0-65535> Integer Enter a value to indicate the number of flush indications to go before the flush-interval timer method triggers and ranges from 0 (default) to 65535.
flush-interval   Enter to configure the flush interval timer value (in centi-seconds).
<centi-seconds (0-500)> Integer Enter a value to indicate the number of flush indications invoked from spanning-tree module per instance basis. This value ranges from 0 to 500 hundredths of a second. If the flush interval timer is set to zero, port and instance based flushing occurs (default functionality). If it is set to non-zero, instance based flushing occurs (dependent on the flush-indication-threshold value).
forward-time   Enter to configure the number of seconds for which a port waits before changing from the blocking state to the forwarding state.

The values configured for the spanning tree timers should satisfy the following conditions:

2 * (forward-time - 1) >= max-age, and

max-age >= 2 * (hello-time +1)

The STP timers can be configured in the switch, only if the spanning tree functionality has not been shut down in the switch. The type of spanning tree mode should be set, if the functionality is already shutdown.

This spanning tree timer’s configuration is not supported in PVRST mode.

<seconds (4-30)> Integer Enter a value to indicate the forward time. This value ranges from 4 to 30 seconds. In MSTP, this time configuration is applied for IST root (that is, MSTI 0). The default is 15 seconds.
hello-time   Enter to configure the time interval (in seconds) between two successive configuration BPDUs generated by the root switch. This value is configured on per-port basis for MSTP and is configured globally for RST.
<seconds (0-2)> Integer Enter a value for hello- time. This value should be either 1 or 2 seconds. The default is 2 seconds.
max-age   Enter to configure the maximum expected arrival time (in seconds) of hello BPDUs. STP information learned from network on any port is discarded, once the configured arrival time expires. The spanning tree topology is re-computed after this time interval.
<seconds (6-40)> Integer Enter a value representing maximum age. This value ranges from 6 to 40 seconds. In MSTP, this time configuration is applied for IST root (that is, MSTI 0). The default is 20 seconds.
forwarddelay   Enter to configure the forward delay timer
optimization   Enter for optimization for spanning-tree related protocol during transition from alternate to designated port role.
alternate-role   Enter to configure the alternate port role transition by optimized configuration.
disabled   Enter to disable optimization for spanning-tree related protocol in alternate port role transition. All ports while transitioning from ALTERNATE-DESIGNATED will have fdWhile set to fwdDelay.
mode   Enter to set the type of spanning tree to be executed, enable spanning tree operation and start spanning tree functionality in the switch.
mst   Enter to configure the switch to execute MSTP for preventing undesirable loops. MSTP configures spanning tree on per VLAN basis or multiple VLANs per spanning tree. The mode cannot be set as mst, if the base bridge Mode is configured as transparent bridging.
pvrst   Enter to configure the switch to execute PVRST+ for preventing undesirable loops. PVRST+ is an enhancement of RSTP which works in combination with VLAN to provide better control over traffic in the network. The Mode cannot be set as pvrst, if the base bridge Mode is configured as transparent bridging. The pvrst can be set as the spanning tree Mode, only if the GVRP feature is disabled.
pvst   Enter to configure the switch to execute PVST for preventing undesirable loops. PVST maintains separate spanning tree instance for each VLAN in the network and forwards VLAN trunk for only some VLANs. The Mode cannot be set as pvst, if the base bridge Mode is configured as transparent bridging. This feature is currently not supported.
rapid-pvst   Enter to configure the switch to execute rapid PVST for preventing undesirable loops. Rapid PVST combines the functionalities of RSTP and PVST, and creates a tree for each VLAN. The Mode cannot be set as rapid-pvst, if the base bridge Mode is configured as transparent bridging. This feature is currently not supported.
rst   Enter to configure the switch to execute RSTP for preventing undesirable loops. RSTP provides rapid recovery of connectivity following the failure of a bridge/bridge port or a LAN.
mst   Enter to start MST configuration
instance ID   Enter to configure the ID of MSTP instance already created in the switch. This option is applicable, only if the spanning tree mode is set as MST.
<instance ID (0-64)> Integer Enter an instance ID. This value ranges from 1 to 64. The special value 4094 can be used only in the switch that supports PBB-TE. This special value represents PTETID that identifies VID used by ESPs.
root   Enter to configure the switch as root.
Note:
This command executes only if
  • instance is created
  • spanning tree mode is set as MST.
primary   Enter to configure the switch as primary root. It sets high enough priority (low value) for the switch so that the switch can be made as the bridge root of the spanning-tree instance. The priority value is set as 24576.
secondary   Enter to configure the switch as secondary root. Sets the switch as a secondary root, if the primary root fails. The priority value is set as 28672.
priority   Enter to switch priority configuration for spanning tree instance
<priority (0-61440)> Integer Enter a priority value. This value ranges from 0 to 61440. The value should be set in steps of 4096, that is, you can set the value as 0, 4096, 8192, 12288, etc. The default is 32768.
flush-indication-threshold   Enter to configure flush indication threshold.
<value (0-65535)> Integer Enter a flush indication threshold value.
configuration   Enter to start MST configuration mode. In MSTP configuration mode, instance specific and MST region configuration can be done.
max-hops   Enter maximum number of hops allowed.
<(6-40)> Integer Enter a value representing maximum number of hops allowed. This value ranges from 6 to 40.
max-instance   Enter maximum MSTP instance value.
pathcost dynamic   Enter to enable dynamic pathcost calculation. Note that the dynamic path cost calculation feature can be configured in the switch, only if the spanning tree functionality has not been shut down in the switch. The type of spanning tree mode should be set, if the functionality is already shutdown
lag-speed   Enter for pathcost calculated when LA port speed changes due to addition or deletion of ports in port channel. Note that the manually assigned path cost is used even if the lag speed feature is enabled in the switch when the path cost is assigned manually.
portfast   Enter to specify the portfast feature in the port. This feature specifies that the port is connected to only one hosts and hence can rapidly transit to forwarding. This feature can cause temporary bridging loops, if hubs, concentrators, switches, bridges and so on are connected to this port. This feature takes effect only after the interface is shutdown and turned on again.
bpduguard   Enter to put an interface in the error-disabled state when it receives a bridge protocol data unit (bpdu).
default   Enter to enable bpduguard by default on all edgeports.
priority   Enter to configure a priority value that is assigned to the switch.
<value (0-61440)> Integer Enter a priority value for the switch and for the MSTI, in RSTP and MSTP respectively. This value ranges from 0 to 61440. The value should be set in steps of 4096, that is, you can set the value as 0, 4096, 8192, 12288 and so on.
transmit   Enter to set the transmit hold-count value for the switch, where the value is a counter that is used to limit the maximum transmission rate of the switch and to avoid flooding. This value specifies the maximum number of packets that can be sent in a given hello time interval. Note that the transmit hold count value configuration is not supported in PVRST Mode.
hold-count   Enter to configure a hold-count counter.
<value (0-61440)> Integer Enter a hold-count value which ranges from 0 to 61440.
vlan   Enter for configures spanning tree related information for VLAN.
<vlan-id/vfi_id> Integer VLAN ID is a unique value that represents the specific VLAN. This value ranges from 1 to 4094. VFI ID is a VLAN created in the system which contains Pseudo wires and Attachment Circuits as member ports. This creates a logical LAN for the VPLS service. This value ranges from 4096 to 65535.The VLAN ID 4095 is reserved and may be used to indicate a wildcard match for the VID in management operations or Filtering Database entries.

VFI IDs 4096 and 4097 are reserved identifiers used in MPLS PW. The theoretical maximum for the maximum number of VFI is 65535 but the actual number of VFI supported is a sizing constant. Based on this, the maximum number of VFI ID accepted in the management interface is restricted. For example, if 100 VFIs are supported, the maximum number of VFI supported will be restricted to maximum number of VLANs + 100. An error message is displayed for any value beyond this range.

forward-time   Enter to configure the number of seconds, a port waits before changing from the listening and learning states to the forwarding state.
<seconds(4-30)> Integer Enter a value which ranges from 4 to 30 seconds. Default is 15.
hello-time   Enter to configure the time interval (in seconds) between two successive configuration BPDUs generated by the root switch.
<seconds(1-10)> Integer Enter a value which ranges from 1 to 10 seconds. Default is 2.
max-age   Enter to configure the maximum expected arrival time (in seconds) of hello BPDUs. STP information learned from network on any port is discarded, once the configured arrival time expires. The spanning tree topology is re-computed after this time interval.
<seconds(6-40)> Integer Enter a value which ranges from 6 to 40 seconds. Default is 20.
hold-count   Enter to configure the maximum number of packets that can be sent in a given hello time interval. This value is used to limit the maximum transmission rate of the switch and to avoid flooding.
<integer(1-10)> Integer Enter a value which ranges from 4 to 10. Default is 3.
brg-priority   Enter to configure the bridge priority to be assigned for the specified VLAN. Default is 32768 + VLAN ID.
<integer(0-61440)> Integer Enter a value which ranges from 0 to 61440. The value should be set in increments of 4096, that is, the value can be set as 0, 4096, 8192, 12288 and so on.
root   Enter to configure Configures the root type for the given VLAN interface.
primary   Enter to configure the switch to become root for a given VLAN. The priority of the switch is lowered until it becomes root
secondary   Enter to configure the switch to become backup root for a given VLAN. The priority of the switch is lowered until it becomes one priority higher than the root, so it can become root if the current root fails

Mode

Global Configuration Mode

Examples

iS5Comm (config)# spanning-tree

iS5Comm(config)#spanning-tree compatibility stp

iS5Comm(config)# spanning-tree flush-indication-threshold 2

iS5Comm(config)# spanning-tree flush-interval 20

iS5Comm(config)# spanning-tree forward-time 6

iS5Comm(config)# spanning-tree max-age 6

iS5Comm(config)# spanning-tree hello-time 6

iS5Comm(config)#spanning-tree mode rst

iS5Comm(config)# spanning-tree mst max-instance 1

iS5Comm(config)# spanning-tree mode mst

Spanning Tree enabled protocol is RSTP, now RSTP is being shutdown and MSTP is being enabled

iS5Comm(config)# spanning-tree mst configuration

Note:

This how MSTP Configuration Mode is entered.

iS5Comm(config)# spanning-tree pathcost dynamic

iS5Comm(config)# spanning-tree portfast bpduguard default

iS5Comm(config)# spanning-tree priority 4096

iS5Comm(config)# spanning-tree transmit hold-count 5

iS5Comm(config)# spanning-tree mode pvrst

Spanning Tree enabled protocol is MSTP, now MSTP is being shutdown. PVRST is started.

iS5Comm(config)# spanning-tree vlan 1 forward-time 18

Forward Time for the given instance is set.

iS5Comm(config-if)# spanning-tree vlan 1 cost 250