Learn how to configure the path cost for an interface to control which interface spanning tree places into the forwarding state when a loop occurs.
You can configure the path cost for an interface to control which interface spanning tree places into the forwarding state when a loop occurs.
This task enables you to assign lower cost values to interfaces that you want selected first and higher cost values to those you want selected last. A lower path cost represents higher-speed transmission. If all interfaces have the same cost value, spanning tree places the interface with the lowest interface number in the forwarding state.
Before you begin
Perform these steps to configure path cost for an interface.
Procedure
| 1. | Use the enable command to enter privileged EXEC mode. Example:
Enter your password if prompted. |
|
| 2. | Use the configure terminal command to enter global configuration mode. Example:
|
|
| 3. | Use the interface interface-id command to specify an interface to configure and enter interface configuration mode. Example:
Valid interfaces include physical ports and port-channel logical interfaces (port-channel port-channel-number). |
|
| 4. | Use the spanning-tree cost command to configure the cost for an interface. Example:
If a loop occurs, spanning tree uses the path cost when selecting an interface to place into the forwarding state. Lower path cost values represent higher-speed transmission. For |
|
| 5. | Use the spanning-tree vlan vlan-id cost cost command to configure the cost for a VLAN. Example:
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 For |
|
| 6. | Use the end command to return to privileged EXEC mode. Example:
|