Command
Spanning-Tree Vlan Port-Priority
Use
If a loop occurs, spanning tree uses the port priority when selecting an interface to put into the forwarding state. Lower is better
Syntax
Switch(config-if)#spanning-tree vlan <vlan range> port-priority <priority>
Example
In the below example we will configure SW2 to prefer to use Fa0/24 if a loop is detected in the network.
SW2(config)#do show spanning vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 8202 Address 0019.060c.4f80 Cost 19 Port 25 (FastEthernet0/23) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 16394 (priority 16384 sys-id-ext 10) Address 0019.060c.cb00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 Interface Role Sts Cost Prio.Nbr Type —————- —- — ——— ——– ——————————– Fa0/19 Desg LRN 19 128.21 P2p Fa0/20 Desg LRN 19 128.22 P2p Fa0/21 Desg FWD 19 128.23 P2p Fa0/22 Desg LRN 19 128.24 P2p Fa0/23 Root LRN 19 128.25 P2p Fa0/24 Altn BLK 19 128.26 P2p
Next, we configure Fa0/24 for VLAN 10 to have a port-priority of 16. Lower is better.
SW2(config)#int fa0/24 SW2(config-if)#spanning vlan 10 port-priority 16
Show spanning vlan 10 reflects the change.
SW2(config-if)#do show spanning vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 8202 Address 0019.060c.4f80 Cost 19 Port 25 (FastEthernet0/23) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 16394 (priority 16384 sys-id-ext 10) Address 0019.060c.cb00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 Interface Role Sts Cost Prio.Nbr Type —————- —- — ——— ——– ——————————– Fa0/19 Desg FWD 19 128.21 P2p Fa0/20 Desg FWD 19 128.22 P2p Fa0/21 Desg FWD 19 128.23 P2p Fa0/22 Desg FWD 19 128.24 P2p Fa0/23 Root FWD 19 128.25 P2p Fa0/24 Altn BLK 19 16.26 P2p