These sections contain this configuration information
•Configuring a Secondary Root Switch (optional)
•Configuring Port Priority (optional)
•Configuring Path Cost (optional)
•Configuring the Switch Priority of a VLAN (optional)
•Configuring Spanning-Tree Timers (optional)
Configuring a Secondary Root Switch
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.
|
Command
|
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.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•(Optional) For diameter net-diameter, specify the maximum number of switches between any two end stations. The range is 2 to 7.
•(Optional) For hello-time seconds, specify the interval in seconds between the generation of configuration messages by the root switch. The range is 1 to 10; the default is 2.
Use the same network diameter and hello-time values that you used when configuring the primary root switch. See the "Configuring the Root Switch" section.
|
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.
Configuring Port Priority
If a loop occurs, spanning tree uses the port priority when selecting an interface to put into the forwarding state. You can assign higher priority values (lower numerical values) to interfaces that you want selected first and lower priority values (higher numerical values) that you want selected last. If all interfaces have the same priority value, spanning tree puts the interface with the lowest interface number in the forwarding state and blocks the other interfaces.
If your switch is a member of a switch stack, you must use the spanning-tree [vlan vlan-id] cost cost interface configuration command instead of thespanning-tree [vlan vlan-id] port-priority priority interface configuration command to select an interface to put in the forwarding state. Assign lower cost values to interfaces that you want selected first and higher cost values that you want selected last.
Beginning in privileged EXEC mode, follow these steps to configure the port priority of an interface. This procedure is optional.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
interfaceinterface-id
|
Specify an interface to configure, and enter interface configuration mode.
Valid interfaces include physical ports and port-channel logical interfaces (port-channel port-channel-number).
|
Step 3
|
spanning-tree port-prioritypriority
|
Configure the port priority for an interface.
For priority, the range is 0 to 240, in increments of 16; the default is 128. Valid values are 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, and 240. All other values are rejected. The lower the number, the higher the priority.
|
Step 4
|
spanning-tree vlan vlan-idport-prioritypriority
|
Configure the port priority for a VLAN.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For priority, the range is 0 to 240, in increments of 16; the default is 128. Valid values are 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, and 240. All other values are rejected. The lower the number, the higher the priority.
|
Step 5
|
end
|
Return to privileged EXEC mode.
|
Step 6
|
show spanning-treeinterfaceinterface-id
or
show spanning-tree vlan vlan-id
|
Verify your entries.
|
Step 7
|
copy running-config startup-config
|
(Optional) Save your entries in the configuration file.
|
The show spanning-tree interface interface-id privileged EXEC command 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 setting, use the no spanning-tree [vlan vlan-id] port-priority interface configuration command. For information on how to configure load sharing on trunk ports by using spanning-tree port priorities,
Configuring Path Cost
The spanning-tree path cost default value is derived from the media speed of an interface. 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 interfaces 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.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
interfaceinterface-id
|
Specify an interface to configure, and enter interface configuration mode. Valid interfaces include physical ports and port-channel logical interfaces (port-channelport-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
|
spanning-tree vlan vlan-id costcost
|
Configure the cost for a VLAN.
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 vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For cost, the range is 1 to 200000000; the default value is derived from the media speed of the interface.
|
Step 5
|
end
|
Return to privileged EXEC mode.
|
Step 6
|
show spanning-tree interfaceinterface-id
or
show spanning-tree vlan vlan-id
|
Verify your entries.
|
Step 7
|
copy running-config startup-config
|
(Optional) Save your entries in the configuration file.
|
The show spanning-tree interface interface-id privileged EXEC command displays information only for ports that are in a link-up operative state. Otherwise, you can use the show running-config privileged EXEC command to confirm the configuration.To return to the default setting, use the no spanning-tree [vlan vlan-id] cost interface configuration command. For information on how to configure load sharing on trunk ports by using spanning-tree path costs,
Configuring the Switch Priority of a VLAN
You can configure the switch priority and make it more likely that a standalone switch or a switch in the stack will be chosen as the root switch.
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.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
spanning-tree vlan vlan-idpriority priority
|
Configure the switch priority of a VLAN.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For priority, the range is 0 to 61440 in increments of 4096; the default is 32768. The lower the number, the more likely the switch will be chosen as the root switch.
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.
Configuring Spanning-Tree Timers
Table 17-4 describes the timers that affect the entire spanning-tree performance.
Table 17-4 Spanning-Tree Timers
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 interface begins forwarding.
|
Maximum-age timer
|
Controls the amount of time the switch stores protocol information received on an interface.
|
Transmit hold count
|
Controls the number of BPDUs that can be sent before pausing for 1 second.
|
The sections that follow provide the configuration steps.
Configuring the Hello Time
You can configure the interval between the generation of configuration messages by the root switch by changing the hello time.
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.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
spanning-tree vlanvlan-id hello-timeseconds
|
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.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For seconds, the range is 1 to 10; the default is 2.
|
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.
Configuring the Forwarding-Delay Time for a VLAN
Beginning in privileged EXEC mode, follow these steps to configure the forwarding-delay time for a VLAN. This procedure is optional.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
spanning-tree vlanvlan-id forward-time seconds
|
Configure the forward time of a VLAN. The forward delay is the number of seconds an interface waits before changing from its spanning-tree learning and listening states to the forwarding state.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For seconds, the range is 4 to 30; the default is 15.
|
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.
Configuring the Maximum-Aging Time for a VLAN
Beginning in privileged EXEC mode, follow these steps to configure the maximum-aging time for a VLAN. This procedure is optional.
|
Command
|
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.
•For vlan-id, you can specify a single VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLANs separated by a comma. The range is 1 to 4094.
•For seconds, the range is 6 to 40; the default is 20.
|
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.
Configuring the Transmit Hold-Count
You can configure the BPDU burst size by changing the transmit hold count value.
Changing this parameter to a higher value can have a significant impact on CPU utilization, especially in Rapid-PVST mode. Lowering this value can slow down convergence in certain scenarios. We recommend that you maintain the default setting.
Beginning in privileged EXEC mode, follow these steps to configure the transmit hold-count. This procedure is optional.
|
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
spanning-tree transmit hold-countvalue
|
Configure the number of BPDUs that can be sent before pausing for 1 second.
For value, the range is 1 to 20; the default is 6.
|
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 transmit hold-count value global configuration command.
Displaying the Spanning-Tree Status
To display the spanning-tree status, use one or more of the privileged EXEC commands in Table 17-5:
Table 17-5 Commands for Displaying Spanning-Tree Status
Command
|
Purpose
|
show spanning-tree active
|
Displays spanning-tree information on active interfaces only.
|
show spanning-tree detail
|
Displays a detailed summary of interface information.
|
show spanning-tree interfaceinterface-id
|
Displays spanning-tree information for the specified 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 [interface interface-id] privileged EXEC
No comments:
Post a Comment