Spanning TreeGlobal Config

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.

Syntax·Global Config
spanning-tree portfast default

When to Use This Command

  • In a network with many access switches, enable PortFast on all end-user ports without configuring each interface individually.
  • When deploying a new switch and you want to ensure all access ports immediately forward traffic to avoid DHCP timeouts.
  • In a data center environment where server ports need to be in forwarding state as soon as they come up.
  • During network maintenance to quickly bring up a large number of access ports after a reboot.

Command Examples

Enable PortFast globally on all access ports

Switch(config)# spanning-tree portfast default
Switch(config)# spanning-tree portfast default
%Warning: this command enables portfast by default on all interfaces. This may create forwarding loops.
Switch(config)#

The command is entered in global configuration mode. The warning message reminds the operator that enabling PortFast globally on all interfaces that are not configured as trunk ports can cause loops if BPDUs are received. The prompt returns to config mode, indicating the command was accepted.

Verify global PortFast default configuration

Switch# show spanning-tree summary
Switch is in pvst mode
Root bridge for: none
EtherChannel misconfiguration guard: disabled
UplinkFast: disabled
BackboneFast: disabled

Extended system ID is enabled
Portfast Default is enabled
PortFast BPDU Guard default: disabled
Portfast BPDU Filter default: disabled
Loopguard default: disabled

Number of spanning-tree interfaces: 24
Number of bridge ports: 24
Number of forward ports: 24
Number of blocked ports: 0
Number of root ports: 0

The output shows 'Portfast Default is enabled' confirming the global command is active. Other related features like BPDU Guard and BPDU Filter are shown as disabled. The number of interfaces and port states are listed for verification.

Understanding the Output

The 'spanning-tree portfast default' command itself does not produce output beyond a warning. To verify, use 'show spanning-tree summary'. In that output, look for 'Portfast Default is enabled' to confirm the feature is active. The warning message is critical: it indicates that all access ports (non-trunk) will now have PortFast enabled, which can cause loops if a switch is accidentally connected to an access port. Always pair this command with BPDU Guard (e.g., 'spanning-tree portfast bpduguard default') to protect against loops. In a real network, after enabling this command, you should see all access ports immediately transition to forwarding state when they come up, reducing convergence time.

CCNA Exam Tips

1.

CCNA exam tip: 'spanning-tree portfast default' only affects ports that are in access mode; trunk ports are excluded.

2.

CCNA exam tip: The command does not enable PortFast on ports that already have PortFast explicitly configured; it only sets the default for ports without explicit configuration.

3.

CCNA exam tip: Always consider enabling BPDU Guard when using PortFast default to prevent accidental loops; the exam may test this pairing.

4.

CCNA exam tip: The warning message about forwarding loops is a common exam distractor; know that it is a normal warning, not an error.

Common Mistakes

Mistake 1: Enabling PortFast default without also enabling BPDU Guard, risking a loop if a switch is connected to an access port.

Mistake 2: Assuming PortFast default applies to trunk ports; it does not—only access ports are affected.

Mistake 3: Forgetting to verify the configuration with 'show spanning-tree summary' after enabling the command.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions