spanning-tree portfast
Enables PortFast on an interface to immediately transition from blocking to forwarding state, bypassing STP listening and learning phases, used on access ports connected to end devices to speed up convergence.
spanning-tree portfastWhen to Use This Command
- Configure PortFast on a switch port connected to a single PC to avoid 30-second STP delay on bootup.
- Enable PortFast on ports connecting to IP phones (with voice VLAN) to ensure immediate connectivity for the phone and attached PC.
- Use PortFast on ports connecting to printers or other network appliances that do not participate in STP.
- Configure PortFast on all access ports in a wiring closet to reduce network downtime when devices reboot.
Command Examples
Enable PortFast on an access port
Switch(config-if)# spanning-tree portfast%Warning: portfast should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to this interface when portfast is enabled, can cause temporary bridging loops. Use with caution %Portfast has been configured on FastEthernet0/1 but will only have effect when the interface is in a non-trunking mode.
The warning message reminds that PortFast should only be used on end-host ports. The second line confirms PortFast is configured but only active when the port is not trunking.
Verify PortFast status on an interface
Switch# show spanning-tree interface fastEthernet 0/1 portfastEdge Port: PortFast is configured, type is edge (portfast) Portfast is enabled by default on this port
The output shows that PortFast is configured and the port is considered an edge port. 'Enabled by default' may appear if global PortFast default is set.
Understanding the Output
When you configure 'spanning-tree portfast' on an interface, the switch immediately transitions the port to forwarding state upon link up, skipping listening and learning. The warning message is critical: it indicates the risk of loops if a switch or hub is connected. The 'show spanning-tree interface' command output shows 'Edge Port: PortFast is configured' confirming the setting. If you see 'Portfast is enabled by default', it means the port inherited PortFast from the global 'spanning-tree portfast default' command. In production, always verify that PortFast is only on access ports; never on trunk ports or ports connecting to other switches. A good value is 'Edge Port: PortFast is configured' with no other STP roles; a bad value would be seeing PortFast on a trunk or a port that later becomes a root port, indicating a potential loop.
CCNA Exam Tips
CCNA exam tip: PortFast bypasses listening and learning states; it does not disable STP — BPDUs are still processed and the port can still transition to blocking if a loop is detected.
CCNA exam tip: PortFast should only be enabled on access ports; enabling it on trunk ports can cause loops and is a common exam trap.
CCNA exam tip: The 'spanning-tree portfast default' global command enables PortFast on all access ports; individual interface configuration overrides the default.
CCNA exam tip: BPDU Guard is often used with PortFast to protect against rogue switches; know that BPDU Guard err-disables the port if a BPDU is received.
Common Mistakes
Mistake: Enabling PortFast on trunk ports — this can cause temporary loops and is a common misconfiguration.
Mistake: Assuming PortFast disables STP entirely — PortFast still processes BPDUs and can transition to blocking if a loop is detected.
Mistake: Forgetting to enable BPDU Guard on PortFast ports — without it, a rogue switch can cause a loop.
Related Commands
show spanning-tree
Displays the Spanning Tree Protocol (STP) state and configuration for all VLANs or a specific VLAN, used to verify root bridge, port roles, and STP topology.
spanning-tree portfast default
Globally enables PortFast on all access ports that are not configured with PortFast individually, allowing them to transition directly to forwarding state and skip listening/learning phases.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions