Command
Spanning-Tree Uplinkfast
Use
This command allows the switch to quickly select another root port if it detects a failure. The new root port moves from blocking to forwarding in under 5 seconds.
Syntax
Switch(config)#spanning-tree uplinkfast
Example

In the below example we will configure SW2 to use uplinkfast. After that, we will disable the links to its root switch SW1. First, we configure uplinkfast globally.
Copy
SW2(config)#spanning uplinkfast
Looking at spanning tree, we see that Fa0/23 is currently the root port.
Copy
SW2(config-if-range)#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 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 128.26 P2p
After disabling both ports to SW1, spanning-tree makes Fa0/21 root and moves the port to forwarding.
Copy
SW2(config)#int ra fa0/23-24
SW2(config-if-range)#shut
SW2(config-if-range)#
00:20:26: %LINK-5-CHANGED: Interface FastEthernet0/23, changed state to administratively down
00:20:26: %LINK-5-CHANGED: Interface FastEthernet0/24, changed state to administratively down
00:20:27: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
SW2(config-if-range)#
00:20:27: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
SW2(config-if-range)#do show spanning vlan 10
VLAN0010
Spanning tree enabled protocol ieee
Root ID Priority 8202
Address 0019.060c.4f80
Cost 38
Port 23 (FastEthernet0/21)
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 Altn BLK 19 128.21 P2p
Fa0/20 Altn BLK 19 128.22 P2p
Fa0/21 Root FWD 19 128.23 P2p
Fa0/22 Altn BLK 19 128.24 P2p
Copy
SW2(config-if-range)#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 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 128.26 P2p