As discussed in the previous post, Spanning-Tree Protocol (STP) helps us to prevent from occurring switching loop. However, the spanning-tree protocol can also create a problem for your network. For example, suppose you have a server that is connected to your switch and you are sure that there are no chances to occur a switching loop, even if the STP is disabled. Participating in the STP process can prevent users from accessing the server resources until the STP convergence is done. Here comes a handy feature called Spanning-Tree PortFast. Using it means the port, on which this feature is enabled, would not participate in the STP process. The ports enabled with the PortFast feature would not spend the usual 50 seconds to come up in to the forwarding mode while STP is converging. Enabling the PortFast feature on all the switches will disable the STP process on all non-trunk ports. It will cause to take less time to change the port states of the interfaces to up on all the non-trunking ports.
The following figure shows the commands used to enable the PortFast feature. First, you need to select an interface for which you want to enable or configure PortFast, and then execute the spanning-tree portfast command to enable this feature.
As shown in the preceding figure, the PortFast feature will only have effect when the interface is in a non-trunking mode. So, enabling the PortFast feature on a trunk port is useless.
How to Configure PortFast on Cisco Switch?
Enabling PortFast on a Cisco switch is pretty simple. Let’s have a look how to enable this feature on an interface. We will use the following topology to demonstrate how to configure PortFast on a Cisco switch.
- Use the physical devices or create the following topology using a simulator, such as Cisco Packet Tracer or GNS3, but do not interconnect the devices now.
- Next, execute the following command on Switch to enable the PortFast feature on the Fa0/1 interface.
Switch(config)#interface fa0/1 Switch(config-if)#spanning-tree portfast
- The following figure shows how to enable PortFast on an interface.
- Now, connect PC0 to the fa0/1 interface and PC1 to the fa0/2 interface, as shown in the following figure.
In the preceding figure, you will notice that the Fa0/1 interface will be activated within 5 seconds because it will not participate in the STP convergence process. But the Fa0/2 interface will take some time, usually 30-50 seconds, in order to come into the Forwarding state. That is what the PortFast feature does.
In this post, we have discussed how the spanning-tree Portfast feature works and how to enable it on an interface. Hope, it helped you. Please share you suggestions and feedback.