How to configure rapid spanning-tree with portfast using the Cisco Packet Tracer

The Rapid Spanning-tree protocol helps provide redundancy and prevent loops in a switched network. In this post, I will use the Cisco Packet Tracer to simulate how we can implement the rapid spanning-tree in a LAN to provide an alternate path to hosts in event of downtime.

Network Topology


  1. The objective of this lab is to configure rapid spanning-tree on SWA and SWB in such a way that SWA will be elected the root bridge.
  2. Configure portfast on SWB’s interface connecting to PC0 to reduce the time required for PC0 to find an alternate path to server0


First, I will enable rapid spanning tree on both switch since by default, they are both running the spanning tree protocol. See below:


SWA(config)#spanning-tree mode rapid


SWB(config)#spanning-tree mode rapid

From the topology above, its is obvious that SWB has been elected the root bridge for VLA1. This is not what I want. The first objective of this lab requires that SWA becomes the root. To achieve this, I will reduce the vlan1 priority of SWA. This can be done in two ways. See below:

Method 1

This method assigns the priority value of 24576 to vlan1. When added to the vlan ID, it becomes 24577. To make SWA the root through the use of this method, I will use the commands below from the global config mode of SWA.

SWA(config)#spanning-tree vlan 1 root primary

Method 2

With this method, I will statically define the priority value for SWA’s vlan1. This method is more effective in a situation where there is a switch on the vlan with a priority value lesser that 24576. However, priority values must be entered in increment of 4096 when using this method. See the commands below:

SWA(config)#sp vlan 1 priority 0

with the command above, SWA is now elected the root bridge for vlan1. We can confirm this with the show spanning-tree vlan 1 command on SWA. See output below:

show spanning tree
Image showing spanning-tree details for vlan 1

Next, on SWA, I will configure portfast on the port connecting to PC0. To do this, I will simply go to the port, which of course must be an access port, and enable portfast. See commands below:

Switch(config)#int f0/3

Switch(config-if)#sw mode access

Switch(config-if)#spanning-tree portfast

That is all there is to it guys. If you would like to get the lab, kindly drop your email address in the comment box below and it will be sent to you. Thanks.

Spread the love


Ashioma Michael, a BSc (Computer Science)., MTCNA, CCNA, and CCNP holder with many years of industry-proven experience in network design, implementation and optimization. He has tutored and guided many professionals towards obtaining their Cisco certifications. Mike works as a senior network engineer with one of the leading internet service providers in West Africa.

Leave a Reply

Your email address will not be published. Required fields are marked *