13-15
Software Configuration Guide—Release 12.2(25)SG
OL-7659-03
Chapter13 Understanding and Conf iguring STP
Configuring STP
This example shows how to configure the spanning tree VLAN port priority of a Fast Ethernet interface:
Switch# configure terminal
Switch(config)# interface fastethernet 5/8
Switch(config-if)# spanning-tree vlan 200 port-priority 64
Switch(config-if)# end
Switch#
This example shows how to verify the configuration of VLAN 200 on the interfa ce when it is configured
as a trunk port:
Switch# show spanning-tree vlan 200
<...output truncated...>
Port 264 (FastEthernet5/8) of VLAN200 is forwarding
Port path cost 19, Port priority 64, Port Identifier 129.8.
Designated root has priority 32768, address 0010.0d40.34c7
Designated bridge has priority 32768, address 0010.0d40.34c7
Designated port id is 128.1, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 0, received 13513
<...output truncated...>
Switch#
Configuring STP Port Cost
The default value for spanning tree port path cost is derived from the interface media speed. In the event
of a loop, spanning tree considers port cost when selecting an interface to put into the forwarding state.
You can assign lower cost values to interfaces that you want spanning tree to select first, and higher cost
values to interfaces that you want spanning tree to select 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 other
interfaces. The possible cost range is 1 through 200,000,000 (the de fault is media-specific).
Spanning tree uses the port cost value when the interface is configured as an access port and uses VLAN
port cost values when the interface is configured as a trunk port.
To configure the spanning tree port cost of an interface, perform this task:
Command Purpose
Step1 Switch(config)# interface {{fastethernet |
gigabitethernet | tengigabitethernet}
slot
/
port
}
| {port-channel
port_channel_number
}
Specifies an interface to configure.
Step2 Switch(config-if)# [no] spanning-tree cost
port_cost
Configures the port cost for an interface. The port_cost
value can be from 1 to 200,000,000.
You can use the no keyword to restore the defaults.
Step3 Switch(config-if)# [no] spanning-tree vlan
vlan_ID
cost
port_cost
Configures the VLAN port cost for an interface. The
port_cost value can be from 1 to 200,000,000.
You can use the no keyword to restore the defaults.
Step4 Switch(config-if)# end Exits configuration mode.
Step5 Switch# show spanning-tree interface
{{fastethernet | gigabitethernet}
slot
/
port
} |
{port-channel
port_channel_number
}
show spanning-tree vlan
vlan_ID
Verifies the configuration.