Spanning Tree Protocol Configuration Guide, Cisco Catalyst IE9300 Rugged Series Switches

PDF

Spanning Tree Protocol Configuration Guide, Cisco Catalyst IE9300 Rugged Series Switches

Configure path cost for an interface

Want to summarize with AI?

Log in

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:

Switch> enable

Enter your password if prompted.

2.

Use the configure terminal command to enter global configuration mode.

Example:

Switch# configure terminal
3.

Use the interface interface-id command to specify an interface to configure and enter interface configuration mode.

Example:

Switch(config)# interface gigabitethernet 1/0/10

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:

Switch(config-if)# spanning-tree cost 4

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 cost, the values range from 1 to 200000000 and the default value is derived from the media speed of the interface.

5.

Use the spanning-tree vlan vlan-id cost cost command to configure the cost for a VLAN.

Example:

Switch(config-if)# spanning-tree vlan 10 cost 1000

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 values range from 1 to 4094.

For cost, the values range from 1 to 200000000; the default value is derived from the media speed of the interface.

6.

Use the end command to return to privileged EXEC mode.

Example:

Switch(config)# end