Open In App

PortFast Configured On a Cisco Switch Port

Last Updated : 27 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Portfast is used to avoid the delay that happens in the spanning tree when connecting a new device to the network. When port fast is enabled on an interface the interface whenever it detects a protocol up the event, the port skips the listening and learning spanning tree states and goes straight to the forwarding state.

Enabling portfast doesn’t mean that the port doesn’t participate in STP elections, BPDUs are still sent and received on the interface. Whenever an interface receives a BPDU it goes to a non-portfast state and starts the election process, this can create a small window where layer 2 loops can occur. To avoid this, portfast is only enabled on edge ports(ports that connect end hosts to the network) and is paired with a BPDU guard for security purposes. Although you can also enable this feature on trunking ports, it is suggested that you only use this feature on edge ports to avoid the formation of layer 2 loops.

 

Configuration:

Portfast on Edge ports: To enable portfast on edge ports, all you need to do is run the following command on the interface:

int e0/0
switchport mode access
spanning-tree portfast edge

 

You will be shown a warning message that is feature is only enabled as long as the port operational mode is access port and this feature should only be used with end hosts. You can perform both of the commands with a single command:

int e0/0
switchport host

 

Enabling Portfast on Trunk Links:

Command to enable portfast on the trunk link

int e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
spanning-tree portfast network

 

 

This time there will be no warning message shown in the console.

Advantages:

  • Devices connected to this port can access the network without waiting for STP convergence on each VLAN.
  • Minimize the amount of time trunk ports waits for the spanning tree to converge.
  • This allows the port to immediately transition from disabled to the forwarding state, thus avoiding the 30-second delay for him accessing the network.
  • Avoid forming spanning tree loops with other directly connected switches.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads