The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to configure the Spanning Tree Protocol (STP) on port-based VLANs on the Cisco router. The router can use the per-VLAN spanning-tree plus (PVST+) protocol based on the IEEE 802.1D standard and Cisco proprietary extensions, or the rapid per-VLAN spanning-tree plus (rapid-PVST+) protocol based on the IEEE 802.1w standard.
For information about the Multiple Spanning Tree Protocol (MSTP) and how to map multiple VLANs to the same spanning-tree instance, see the Multiple Spanning Tree Protocol chapter.
Note | For complete syntax and usage information for the commands used in this chapter, see the command reference for this release. |
STP is a Layer 2 link management protocol that provides path redundancy while preventing loops in the network. For a Layer 2 Ethernet network to function properly, only one active path can exist between any two stations. Multiple active paths among end stations cause loops in the network. If a loop exists in the network, end stations might receive duplicate messages. Switches might also learn end-station MAC addresses on multiple Layer 2 interfaces. These conditions result in an unstable network. Spanning-tree operation is transparent to end stations, which cannot detect whether they are connected to a single LAN segment or a switched LAN of multiple segments.
The STP uses a spanning-tree algorithm to select one switch of a redundantly connected network as the root of the spanning tree. The algorithm calculates the best loop-free path through a switched Layer 2 network by assigning a role to each port based on the role of the port in the active topology:
The switch that has all of its ports as the designated role or the backup role is the root switch. The switch that has at least one of its ports in the designated role is called the designated switch.
Spanning tree forces redundant data paths into a standby (blocked) state. If a network segment in the spanning tree fails and a redundant path exists, the spanning-tree algorithm recalculates the spanning-tree topology and activates the standby path. Switches send and receive spanning-tree frames, called bridge protocol data units (BPDUs), at regular intervals. The switches do not forward these frames but use them to construct a loop-free path. BPDUs contain information about the sending switch and its ports, including switch and MAC addresses, switch priority, port priority, and path cost. Spanning tree uses this information to elect the root switch and root port for the switched network and the root port and designated port for each switched segment.
When two ports on a switch are part of a loop, the spanning-tree port priority and path cost settings control which port is put in the forwarding state and which is put in the blocking state. The spanning-tree port priority value represents the location of a port in the network topology and how well it is located to pass traffic. The path cost value represents the media speed.
The stable, active spanning-tree topology of a switched network is controlled by these elements:
When the switches in a network are powered up, each functions as the root switch. Each switch sends a configuration BPDU through all of its ports only through the STP-enabled ports. The BPDUs communicate and compute the spanning-tree topology. Each configuration BPDU contains this information:
When a switch receives a configuration BPDU that contains superior information (lower bridge ID, lower path cost, and so forth), it stores the information for that port. If this BPDU is received on the root port of the switch, the switch also forwards it with an updated message to all attached LANs for which it is the designated switch.
If a switch receives a configuration BPDU that contains inferior information to that currently stored for that port, it discards the BPDU. If the switch is a designated switch for the LAN from which the inferior BPDU was received, it sends that LAN a BPDU containing the up-to-date information stored for that port. In this way, inferior information is discarded, and superior information is propagated on the network.
A BPDU exchange results in these actions:
For each VLAN, the switch with the highest switch priority (the lowest numerical priority value) is elected as the root switch. If all switches are configured with the default priority (32768), the switch with the lowest MAC address in the VLAN becomes the root switch. The switch priority value occupies the most significant bits of the bridge ID, as shown in tables Switch Priority Value and Extended System ID and Spanning-Tree Timer.
All paths that are not needed to reach the root switch from anywhere in the switched network are placed in the spanning-tree blocking mode.
The IEEE 802.1D standard requires that each switch has an unique bridge identifier (bridge ID), which controls the selection of the root switch. Because each VLAN is considered as a different logical bridge with PVST+ and rapid PVST+, the same switch must have as many different bridge IDs as VLANs configured on it. Each VLAN on the switch has a unique 8-byte bridge ID. The two most-significant bytes are used for the switch priority, and the remaining six bytes are derived from the switch MAC address.
The switch supports the IEEE 802.1t spanning-tree extensions, and some of the bits previously used for the switch priority are now used as the VLAN identifier. The result is that fewer MAC addresses are reserved for the switch, and a larger range of VLAN IDs can be supported, all while maintaining the uniqueness of the bridge ID. As shown in table Switch Priority Value and Extended System ID, the two bytes previously used for the switch priority are reallocated into a 4-bit priority value and a 12-bit extended system ID value equal to the VLAN ID.
Switch Priority Value |
Extended System ID (Set Equal to the VLAN ID) |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Bit 16 |
Bit 15 |
Bit 14 |
Bit 13 |
Bit 12 |
Bit 11 |
Bit 10 |
Bit 9 |
Bit 8 |
Bit 7 |
Bit 6 |
Bit 5 |
Bit 4 |
Bit 3 |
Bit 2 |
Bit 1 |
32768 |
16384 |
8192 |
4096 |
2048 |
1024 |
512 |
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
Spanning tree uses the extended system ID, the switch priority, and the allocated spanning-tree MAC address to make the bridge ID unique for each VLAN.
Support for the extended system ID affects how you manually configure the root switch, the secondary root switch, and the switch priority of a VLAN. For example, when you change the switch priority value, you change the probability that the switch will be elected as the root switch. Configuring a higher value decreases the probability; a lower value increases the probability. For more information, see the Configuring the Root Switch section, the Configuring a Secondary Root Switch section, and the Configuring the Switch Priority of a VLAN section.
Propagation delays can occur when protocol information passes through a switched LAN. As a result, topology changes can take place at different times and at different places in a switched network. When an STP port transitions directly from nonparticipation in the spanning-tree topology to the forwarding state, it can create temporary data loops. Interfaces must wait for new topology information to propagate through the switched LAN before starting to forward frames. They must allow the frame lifetime to expire for forwarded frames that have used the old topology.
Each Layer 2 interface on a switch using spanning tree exists in one of these states:
A port participating in spanning tree moves through these states:
The figure below shows how an interface moves through the states.
Spanning tree is not enabled by default. Once the spanning tree mode is selected, each VLAN on ports goes through the blocking state and the transitionary states of listening and learning. Spanning tree stabilizes each interface at the forwarding or blocking state.
When the spanning-tree algorithm places a Layer 2 spanning-tree interface in the forwarding state, this process occurs:
A Layer 2 interface in the blocking state does not participate in frame forwarding. After initialization, a BPDU is sent to each switch interface, or to each switch STP port. A switch initially functions as the root until it exchanges BPDUs with other switches. This exchange establishes which switch in the network is the root or root switch. If there is only one switch in the network, no exchange occurs, the forward-delay timer expires, and the interface moves to the listening state. An interface participating in spanning tree always enters the blocking state after switch initialization.
An interface in the blocking state performs these functions:
The listening state is the first state a Layer 2 interface enters after the blocking state. The interface enters this state when the spanning tree decides that the interface should participate in frame forwarding.
An interface in the listening state performs these functions:
A Layer 2 interface in the learning state prepares to participate in frame forwarding. The interface enters the learning state from the listening state.
An interface in the learning state performs these functions:
A Layer 2 interface in the forwarding state forwards frames. The interface enters the forwarding state from the learning state.
An interface in the forwarding state performs these functions:
A Layer 2 interface in the disabled state does not participate in frame forwarding or in the spanning tree. An interface in the disabled state is non operational.
A disabled interface performs these functions:
If all switches in a network are enabled with default spanning-tree settings, the switch with the lowest MAC address becomes the root switch. In the figure below , Switch A is elected as the root switch because the switch priority of all the switches is set to the default (32768) and Switch A has the lowest MAC address. However, because of traffic patterns, number of forwarding interfaces, or link types, Switch A might not be the ideal root switch. By increasing the priority (lowering the numerical value) of the ideal switch so that it becomes the root switch, you force a spanning-tree recalculation to form a new topology with the ideal switch as the root.
When the spanning-tree topology is calculated based on default parameters, the path between source and destination end stations in a switched network might not be ideal. For instance, connecting higher-speed links to an interface that has a higher number than the root port can cause a root-port change. The goal is to make the fastest link the root port.
For example, assume that one port on Switch B is a Gigabit Ethernet link and that another port on Switch B (a 10/100 link) is the root port. Network traffic might be more efficient over the Gigabit Ethernet link. By changing the spanning-tree port priority on the Gigabit Ethernet port to a higher priority (lower numerical value) than the root port, the Gigabit Ethernet port becomes the new root port.
You can create a redundant backbone with spanning tree by connecting two switch interfaces that are participating in spanning tree to another device or to two different devices, as shown in the figure below. Spanning tree automatically disables one interface but enables it if the other one fails. If one link is high-speed and the other is low-speed, the low-speed link is always disabled. If the speeds are the same, the port priority and port ID are added together, and spanning tree disables the link with the lowest value.
You can also create redundant links between switches by using EtherChannel groups.
The following spanning-tree modes and protocols are supported:
The PVST+ provides Layer 2 load balancing for the VLAN on which it runs. You can create different logical topologies by using the VLANs on your network to ensure that all of your links are used but that no one link is oversubscribed. Each instance of PVST+ on a VLAN has a single root switch. This root switch propagates the spanning-tree information associated with that VLAN to all other switches in the network. Because each switch has the same information about the network, this process ensures that the network topology is maintained.
The rapid PVST+ uses the same configuration as PVST+ (except where noted), and the switch needs only minimal extra configuration. The benefit of rapid PVST+ is that you can migrate a large PVST+ install base to rapid PVST+ without having to learn the complexities of the MSTP configuration and without having to reprovision your network. In rapid-PVST+ mode, each VLAN runs its own spanning-tree instance up to the maximum supported.
The most common initial deployment of MSTP is in the backbone and distribution layers of a Layer 2 switched network. For more information, see Multiple Spanning Tree Protocol chapter.
For information about the number of supported spanning-tree instances, see Restrictions for PVST+ and RPVST+.
The table below lists the interoperability and compatibility among the supported spanning-tree modes in a network.
|
PVST+ |
MSTP |
Rapid PVST+ |
---|---|---|---|
PVST+ |
Yes |
Yes (with restrictions) |
Yes (reverts to PVST+) |
MSTP |
Yes (with restrictions) |
Yes |
Yes (reverts to PVST+) |
Rapid PVST+ |
Yes (reverts to PVST+) |
Yes (with restrictions) |
Yes |
In a mixed MSTP and PVST+ network, the common spanning-tree (CST) root must be inside the MST backbone, and a PVST+ switch cannot connect to multiple MST regions.
When a network contains switches running rapid PVST+ and switches running PVST+, we recommend that the rapid-PVST+ switches and PVST+ switches be configured for different spanning-tree instances. In the rapid-PVST+ spanning-tree instances, the root switch must be a rapid-PVST+ switch. In the PVST+ instances, the root switch must be a PVST+ switch. The PVST+ switches should be at the edge of the network.
The table below shows the default spanning-tree configuration.
Feature |
Default Setting |
---|---|
Enable state |
Enabled on ports in VLAN 1. |
Spanning-tree mode |
Disabled. |
Switch priority |
32768. |
Spanning-tree port priority (configurable on a per-interface basis) |
128. |
Spanning-tree port cost (configurable on a per-interface basis) |
1000 Mbps: 4. 100 Mbps: 19. 10 Mbps: 100. |
Spanning-tree VLAN port priority (configurable on a per-VLAN basis) |
128. |
Spanning-tree VLAN port cost (configurable on a per-VLAN basis) |
1000 Mbps: 4. 100 Mbps: 19. 10 Mbps: 100. |
Spanning-tree timers |
Hello time: 2 seconds. Forward-delay time: 15 seconds. Maximum-aging time: 20 seconds. |
The switch supports three spanning-tree modes: MSTP, PVST+, rapid PVST+.
Note | By default, spanning-tree is disabled. |
Use the following procedure to configure spanning-tree mode:
1.
configure
terminal
2. spanning-tree mode {pvst | rapid-pvst
3.
spanning-tree
vlan
vlan-range
4.
end
Command or Action | Purpose |
---|
Beginning in privileged EXEC mode, follow these steps to configure the L2 protocol peer under EFP/TEFP. This procedure is optional.
1.
configure
terminal
2.
interface
TenGigabitEthernetslot/subslot/port
3.
no
ip
address
4.
service
instance
trunk
trunk
id
ethernet
5.
encapsulation
dot1q
vlan-id
6.
rewrite
ingress
tag
pop
1
symmetric
7.
l2protocol
peer
stp
8.
bridge-domain
from
encapsulation
9.
end
Note | You must configure l2protocol peer stp command under all the EFP where you prefer to run STP. |
Disable spanning tree only if you are sure there are no loops in the network topology.
Caution | When spanning tree is disabled and loops are present in the topology, excessive traffic and indefinite packet duplication can drastically reduce network performance. |
Beginning in privileged EXEC mode, follow these steps to disable spanning-tree on a per-VLAN basis. This procedure is optional.
1.
configure
terminal
2.
no
spanning-tree
vlan
vlan-id
3.
end
4.
show
spanning-tree
vlan
vlan-id
Command or Action | Purpose |
---|
To re-enable spanning-tree, use the spanning-tree vlan vlan-id global configuration command.
Use the below commands to verify PVST and RPVST settings:
router#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address a89d.21ed.bbbd Cost 6 Port 18 (GigabitEthernet0/0/11) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address b0aa.7754.553d Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 0 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/0/7 Altn BLK 4 128.14 P2p Gi0/0/11 Root FWD 4 128.18 P2p
router#show spanning-tree interface gigabitEthernet 0/0/7 detail Port 14 (GigabitEthernet0/0/7) of VLAN0001 is alternate blocking Port path cost 4, Port priority 128, Port Identifier 128.14. Designated root has priority 32769, address a89d.21ed.bbbd Designated bridge has priority 32769, address b0aa.7737.9dbd Designated port id is 128.14, designated path cost 4 Timers: message age 4, forward delay 0, hold 0 Number of transitions to forwarding state: 1 Link type is point-to-point by default BPDU: sent 91, received 8394
router#show spanning-tree summary Switch is in pvst mode Root bridge for: none EtherChannel misconfig guard is enabled Extended system ID is enabled Portfast Default is disabled PortFast BPDU Guard Default is disabled Portfast BPDU Filter Default is disabled Loopguard Default is disabled UplinkFast is disabled BackboneFast is disabled Configured Pathcost method used is short Name Blocking Listening Learning Forwarding STP Active ---------------------- -------- --------- -------- ---------- ---------- VLAN0001 1 0 0 1 2 VLAN0002 1 0 0 1 2 VLAN0003 1 0 0 1 2 VLAN0004 1 0 0 1 2 VLAN0005 1 0 0 1 2 VLAN0006 1 0 0 1 2
The switch maintains a separate spanning-tree instance for each active VLAN configured on it. A bridge ID, consisting of the switch priority and the switch MAC address, is associated with each instance. For each VLAN, the switch with the lowest bridge ID becomes the root switch for that VLAN.
To configure a switch to become the root for the specified VLAN, use the spanning-tree vlan vlan-id root global configuration command to modify the switch priority from the default value (32768) to a significantly lower value. When you enter this command, the software checks the switch priority of the root switches for each VLAN. Because of the extended system ID support, the switch sets its own priority for the specified VLAN to 24576 if this value will cause this switch to become the root for the specified VLAN.
If any root switch for the specified VLAN has a switch priority lower than 24576, the switch sets its own priority for the specified VLAN to 4096 less than the lowest switch priority. (4096 is the value of the least-significant bit of a 4-bit switch priority value as shown in Table 14-1 on page 14-4 .)
Note | The spanning-tree vlan vlan-id root global configuration command fails if the value necessary to be the root switch is less than 1. |
If your network consists of switches that both do and do not support the extended system ID, it is unlikely that the switch with the extended system ID support will become the root switch. The extended system ID increases the switch priority value every time the VLAN number is greater than the priority of the connected switches running older software.
Note | The root switch for each spanning-tree instance should be a backbone or distribution switch. Do not configure an access switch as the spanning-tree primary root. |
Use the diameter keyword to specify the Layer 2 network diameter (that is, the maximum number of switch hops between any two end stations in the Layer 2 network). When you specify the network diameter, the switch automatically sets an optimal hello time, forward-delay time, and maximum-age time for a network of that diameter, which can significantly reduce the convergence time. You can use the hello keyword to override the automatically calculated hello time.
Note | After configuring the switch as the root switch, we recommend that you avoid manually configuring the hello time, forward-delay time, and maximum-age time through the spanning-tree vlanvlan-id hello-time, spanning-tree vlanvlan-id forward-time, and the spanning-tree vlanvlan-id max-age global configuration commands. |
Beginning in privileged EXEC mode, follow these steps to configure a switch to become the root for the specified VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
root
primary [diameter
net-diameter [hello-time
seconds ]]
3.
end
4.
show
spanning-tree
detail
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
root
primary [diameter
net-diameter [hello-time
seconds ]]
|
Configure a switch to become the root for the specified VLAN.
|
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
detail
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id root global configuration command.
When you configure a switch as the secondary root, the switch priority is modified from the default value (32768) to 28672. The switch is then likely to become the root switch for the specified VLAN if the primary root switch fails. This is assuming that the other network switches use the default switch priority of 32768 and therefore are unlikely to become the root switch.
You can execute this command on more than one switch to configure multiple backup root switches. Use the same network diameter and hello-time values that you used when you configured the primary root switch with the spanning-tree vlan vlan-id root primary global configuration command .
Beginning in privileged EXEC mode, follow these steps to configure a switch to become the secondary root for the specified VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
root
secondary [diameter
net-diameter
[hello-time
seconds ]]
3.
end
4.
show
spanning-tree
detail
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
root
secondary [diameter
net-diameter
[hello-time
seconds ]]
|
Configure a switch to become the secondary root for the specified VLAN.
Use the same network diameter and hello-time values that you used when configuring the primary root switch. See Configuring the Root Switch. |
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
detail
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id root global configuration command.
If a loop occurs, spanning tree uses the port priority when selecting a spanning-tree port to put into the forwarding state. You can assign higher priority values (lower numerical values) to ports that you want selected first and lower priority values (higher numerical values) to ones that you want selected last. If all spanning-tree ports have the same priority value, spanning tree puts the port with the lowest interface number in the forwarding state and blocks the other interfaces.
Beginning in privileged EXEC mode, follow these steps to configure the port priority of a spanning-tree port. This procedure is optional.
1.
configure
terminal
2.
interface
interface-id
3.
spanning-tree
port-priority
priority
4.
end
5.
Do one of the
following:
6.
copy
running-config
startup-config
Note | The show spanning-tree interface interface-id privileged EXEC c ommand displays information only if the port is in a link-up operative state. Otherwise, you can use the show running-config interface privileged EXEC command to confirm the configuration. |
To return to the default spanning-tree setting, use the no spanning-tree [vlan vlan-id port-priority interface configuration command.
The spanning-tree path cost default value is derived from the media speed of an interface (port running spanning tree or port channel of multiple ports running spanning tree). If a loop occurs, spanning tree uses cost when selecting an interface to put in the forwarding state. You can assign lower cost values to interfaces that you want selected first and higher cost values that you want selected last. If all NNIs (or port channels) have the same cost value, spanning tree puts the interface with the lowest interface number in the forwarding state and blocks the other interfaces.
Beginning in privileged EXEC mode, follow these steps to configure the cost of an interface. This procedure is optional.
1.
configure
terminal
2.
interface
interface-id
3.
spanning-tree
cost
cost
4.
end
5.
Do one of the
following:
6.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | interface
interface-id
|
Specify an interface to configure, and enter interface configuration mode. Valid interfaces include physical interfaces and port-channel logical interfaces (port-channel port-channel-number ). |
Step 3 | spanning-tree
cost
cost
|
Configure the cost for an interface. If a loop occurs, spanning tree uses the path cost when selecting an interface to place into the forwarding state. A lower path cost represents higher-speed transmission. For cost, the range is 1 to 200000000; the default value is derived from the media speed of the interface. |
Step 4 | end
|
Return to privileged EXEC mode. |
Step 5 | Do one of the
following:
|
Verify your entries. |
Step 6 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
Note | The show spanning-tree interface interface-id privileged EXEC c ommand displays information only for ports that are in a link-up operative state. Otherwise, you can use the show running-config privileged EXEC co mmand to confirm the configuration. |
To return to the default setting, use the no spanning-tree [vlan vlan-id ] cost interface configuration command.
You can configure the switch priority and make it more likely that the switch will be chosen as the root switch.
Note | Exercise care when using this command. For most situations, we recommend that you use the spanning-tree vlan vlan-id root primary and the spanning-tree vlan vlan-id root secondary global configuration commands to modify the switch priority. |
Beginning in privileged EXEC mode, follow these steps to configure the switch priority of a VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
priority
priority
3.
end
4.
show
spanning-tree
vlan
vlan-id
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
priority
priority
|
Configure the switch priority of a VLAN.
Valid priority values are 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, and 61440. All other values are rejected. |
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
vlan
vlan-id
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id priority global configuration command.
Variable |
Description |
---|---|
Hello timer |
Controls how often the switch broadcasts hello messages to other switches. |
Forward-delay timer |
Controls how long each of the listening and learning states last before the STP port begins forwarding. |
Maximum-age timer |
Controls the amount of time the switch stores protocol information received on an STP port. |
You can configure the interval between the generation of configuration messages by the root switch by changing the hello time.
Note | Exercise care when using this command. For most situations, we recommend that you use the spanning-tree vlan vlan-id root primary and the spanning-tree vlan vlan-id root secondary global configuration commands to modify the hello time. |
Beginning in privileged EXEC mode, follow these steps to configure the hello time of a VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
hello-time
seconds
3.
end
4.
show
spanning-tree
vlan
vlan-id
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
hello-time
seconds
|
Configure the hello time of a VLAN. The hello time is the interval between the generation of configuration messages by the root switch. These messages mean that the switch is alive.
|
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
vlan
vlan-id
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id hello-time global configuration command.
Beginning in privileged EXEC mode, follow these steps to configure the forwarding-delay time for a VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
forward-time
seconds
3.
end
4.
show
spanning-tree
vlan
vlan-id
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
forward-time
seconds
|
Configure the forward time of a VLAN. The forward delay is the number of seconds a spanning-tree port waits before changing from its spanning-tree learning and listening states to the forwarding state.
|
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
vlan
vlan-id
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id forward-time global configuration command.
Beginning in privileged EXEC mode, follow these steps to configure the maximum-aging time for a VLAN. This procedure is optional.
1.
configure
terminal
2.
spanning-tree
vlan
vlan-id
max-age
seconds
3.
end
4.
show
spanning-tree
vlan
vlan-id
5.
copy
running-config
startup-config
Command or Action | Purpose | |
---|---|---|
Step 1 | configure
terminal
|
Enter global configuration mode. |
Step 2 | spanning-tree
vlan
vlan-id
max-age
seconds
|
Configure the maximum-aging time of a VLAN. The maximum-aging time is the number of seconds a switch waits without receiving spanning-tree configuration messages before attempting a reconfiguration.
|
Step 3 | end
|
Return to privileged EXEC mode. |
Step 4 | show
spanning-tree
vlan
vlan-id
|
Verify your entries. |
Step 5 | copy
running-config
startup-config
|
(Optional) Save your entries in the configuration file. |
To return to the default setting, use the no spanning-tree vlan vlan-id max-age global configuration command.
To display the spanning-tree status, use one or more of the privileged EXEC commands in the table below:
Command |
Purpose |
---|---|
show spanning-tree active |
Displays spanning-tree information only on active spanning-tree interfaces. |
show spanning-tree detail |
Displays a detailed summary of interface information. |
show spanning-tree interface interface-id |
Displays spanning-tree information for the specified spanning-tree interface. |
show spanning-tree summary totals |
Displays a summary of interface states or displays the total lines of the STP state section. |
You can clear spanning-tree counters by using the clear spanning-tree [interfaceinterface-id ] privileged EXEC command.
For information about other keywords for the show spanning-tree privileged EXEC command, see the command reference for this release.