What does spanning-tree PortFast do?
PortFast causes a switch or trunk port to enter the spanning tree forwarding state immediately, bypassing the listening and learning states.
Portfast is appropriate when you are sure that you are connecting to a single device that will not potentially bridge you to other ports.
When PortFast feature is enabled on a switch or a trunk port, the port immediately transitions to the STP forwarding state. Though PortFast is enabled the port still participates in STP. If the port happens to be part of topology that could form a loop, the port eventually transitions into STP blocking mode.
Portfast does two things for us: Interfaces with portfast enabled that come up will go to forwarding mode immediately, the interface will skip the listening and learning state. A switch will never generate a topology change notification for an interface that has portfast enabled.
Because the purpose of PortFast is to minimize the time that access ports must wait for STP to converge, it should only be used on access ports. If you enable PortFast on a port connected to a switch, you might create a temporary bridging loop.
What is STP and how does it work? Spanning Tree Protocol (STP) is a Layer 2 network protocol used to prevent looping within a network topology. STP was created to avoid the problems that arise when computers exchange data on a local area network (LAN) that contains redundant paths.
A common misunderstanding among Cisco students is that portfast disables spanning-tree on a certain interface. This is not correct however…if you enable portfast on an interface then it will jump to the forwarding state of spanning-tree. We still run spanning-tree on the interface!
The port will send out few bpdus at link up, to detect cabling error, and then will stay silent. As soon as a bpdu is received (if any is received), portfast and thus bpdufilter is disabled.
PortFast is a Cisco feature for PVST+ environments. When a switch port is configured with PortFast that port transitions from blocking to forwarding state immediately, bypassing the usual 802.1D STP transition states (the listening and learning states).
The portfast feature immediately transitions the port into STP forwarding mode upon link-up.
What is spanning-tree PortFast and Bpduguard?
The PortFast and BPDU. A BPDU is a data message transmitted across a local area network to detect loops in network topologies. Guard features enhance network reliability, manageability, and security for Layer-2 STP. STP is a network protocol that builds a logical loop-free topology for Ethernet networks. .
PortFast and BPDU guard are disabled, by default, on all interfaces.

Which is the true statement about STP PortFast mode? The port bypasses the normal STP startup process and enters forwarding mode immediately. Special BPDUs are generated to notify the other switches that the port is an access port and any switches connected to it should cause the port to be disabled.
The spanning-tree portfast has no effect on trunk ports. If you want to make a trunk port become Forwarding imediately after coming up, you need the spanning-tree porfast trunk command.
Of course the caveat from Cisco - Caution: Never use the PortFast feature on switch ports that connect to other switches, hubs, or routers. These connections can cause physical loops, and spanning tree must go through the full initialization procedure in these situations.
PortFast enables the switch to instantaneously transition from blocking state to forwarding state immediately through bypassing the listening and learning state. However, PortFast is highly recommended only on non-trunking access ports, such as edge ports, because these ports typically do not send nor receive BPDU.
You can use the "show spanning-tree interface faX/X detail" command. It will show portfast is enabled or disabled.
PortFast feature should be used only to connect a single workstation to a switch port to avoid layer 2 switching loop. Spanning Tree PortFast feature causes a port to enter the forwarding state immediately, bypassing the listening and learning states.
Portfast is a Cisco technique that puts a switch interface into forwarding mode immediately, skipping the listening and learning states. This is useful for interfaces that connect to computers or servers so that these devices don't have to wait until the interface is up and running.
PortFast and BPDU guard are disabled, by default, on all interfaces.
How to check portfast in Cisco?
You can use the "show spanning-tree interface faX/X detail" command. It will show portfast is enabled or disabled.
You configure the command “spanning-tree portfast” on all the ports connecting to end devices like workstations. They then automatically bypass the waiting period and DHCP works properly. It's important to only configure this command on ports that connect to end devices though.
To configure Spanning Tree Protocol (STP) PortFast on a Switch running IOS, run "spanning-tree portfast" command as shown below. To view the configured Spanning Tree PortFast enabled ports, run the "show running-config" IOS command as shown below. We can see that PortFast is enabled on access ports fa0/1 to fa0/24.
- Enter the configuration mode for the interface. ...
- Shut down the interface. ...
- Change the portfast setting. ...
- Review the portfast status. ...
- Reset the default spanning tree portfast value for the interface. ...
- Review the portfast status.
How does configuring a port with PortFast allow for faster convergence? PortFast allows for an access port to immediately transition into a forwarding state which decreases Layer 2 convergence time.