Course contents

Chapter 6: Spanning Tree ProtocolLesson 15 of 25

PortFast

Why does a PC's cable show a link while its first network requests still fail? Let's check whether the switch is waiting for spanning tree, and when an edge port can safely skip that wait.

Intermediate · 5 min read

A link is up, but the first request is lost

A user connects PC 2 to SW3 Gi1/0/11 in VLAN 10. The PC sends a DHCP (Dynamic Host Configuration Protocol) discovery message to request its IPv4 configuration. In classic STP, an ordinary non-edge port can spend 15 seconds listening and 15 seconds learning before forwarding user frames. A request sent during that period is not forwarded, even though the physical link is up.

The DHCP client may retry and recover after forwarding starts. Some clients use an IPv4 link-local address in 169.254.0.0/16 when they cannot obtain a lease. That is a real address with limited local scope, not proof of a PortFast fault. A missing DHCP server, wrong VLAN or filtering can produce similar symptoms.

PC 1 uses Gi1/0/10 without PortFast; PC 2 uses Gi1/0/11 with it. Both belong to VLAN 10 and seek leases on 192.168.10.0/24. Before a lease is assigned, that subnet is the intended result, not an address the client already owns. The diagram omits the upstream DHCP service and shows only the local forwarding decision.

Edge ports skip the wait

PortFast makes the port an edge port. An edge port is intended to connect to an endpoint without another Layer 2 path back into the switched network. When its link becomes operational, PortFast permits immediate STP forwarding instead of the normal non-edge wait. It does not speed up link negotiation, authenticate the user or make DHCP answer faster.

Operational edge-port changes avoid the same topology-change processing as ordinary non-edge forwarding transitions. This reduces unnecessary MAC-table disruption as users connect and disconnect. A PC or server is not inherently loop-free: software bridging, extra adapters or changed cabling can violate the edge assumption.

Diagram
With and without PortFast
With and without PortFast
Access switchPC 1Gi1/0/10 · no PortFastPC 2Gi1/0/11 · PortFast

Device key: PC 1, PC 2 (computer)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type. Blocked: forwarding prevented by a port or policy. Down: failed link. Read the step for the cause.

  1. 1. Both PCs boot. Both send a DHCP request as soon as their cable is connected.
  2. 2. PC 2's request can leave. Its PortFast port is forwarding; DHCP and other policy checks must still succeed.
  3. 3. PC 1 waits. Its port is still listening, then learning. It only forwards after about 30 s.
Classic non-edge waiting is compared with an operational PortFast port. The arrows are DHCP client messages; early forwarding alone does not guarantee a lease or Internet access.

Turning PortFast on

These Cisco IOS/IOS XE style commands start in global configuration mode. VLAN 10 must already exist. Check show spanning-tree summary to identify the active mode; classic PVST+ and Rapid PVST+ have different transition mechanisms. Some releases use explicit edge syntax.

interface GigabitEthernet1/0/11 switchport mode access switchport access vlan 10 spanning-tree portfast

SW3 Gi1/0/11, connected only to the verified endpoint. A corresponding command on releases with explicit edge syntax is spanning-tree portfast edge. Check the image's command reference.

spanning-tree portfast default

Alternative global policy: enable PortFast by default on non-trunking ports. Explicitly exclude non-trunk switch links and other ports that are not verified edges.

interface GigabitEthernet1/0/20 switchport mode trunk spanning-tree portfast trunk

Separate design example for a verified endpoint trunk with no bridging return path. Some releases use spanning-tree portfast edge trunk. Do not apply it to an ordinary switch-to-switch trunk.

Warning: if someone plugs a switch into a PortFast port (or connects a cable in a loop), the port forwards at once. A loop can form before STP reacts. BPDU Guard can place a port into err-disabled, a protective stopped state, on receiving a BPDU (Bridge Protocol Data Unit), an STP control message. Without an active guard, receiving a BPDU removes operational edge status and normal spanning-tree handling applies. That is not a guarantee against a transient loop or a device hiding BPDUs.

Checking that a port is an edge port

Illustrative IOS/IOS XE output · operational edge endpoint
SW3#show spanning-tree interface GigabitEthernet1/0/11 portfast
VLAN0010            enabled

In show spanning-tree vlan 10, the Type column for the port shows Edge (for example P2p Edge).

A server restart, with and without PortFast

This separate comparison uses a server on SW3 Gi1/0/10 in VLAN 10. The excerpts illustrate classic PVST+ with default forward delay, first without PortFast and then as an operational edge. They are not captures or a reason to enable a busy debug on a working switch.

Illustrative classic PVST+ events · no PortFast, not a lab capture
10:00:00.100: STP: VLAN0010 Gi1/0/10 -> listening
10:00:15.100: STP: VLAN0010 Gi1/0/10 -> learning
10:00:30.100: STP: VLAN0010 sent Topology Change Notice on Gi1/0/1
10:00:30.100: STP: VLAN0010 Gi1/0/10 -> forwarding
User frames are not forwarded during the two waiting stages. A non-edge transition can trigger classic topology-change processing and accelerated MAC ageing in the tree. The event sequence depends on mode, role and transition, not simply every physical up/down event.
Illustrative classic PVST+ events · operational PortFast endpoint
10:05:00.100: STP: VLAN0010 Gi1/0/10 ->jump to forwarding from blocking
Forwarding at once, and no TCN.

PortFast doesn't turn STP off

Many people think it does, but it doesn't. A PortFast port is still participates in STP. In the healthy endpoint example it is designated and forwarding, with normal BPDU transmission and reception unless another feature changes that behaviour. PortFast does not suppress BPDUs. The separate BPDU Filter feature must not be confused with it.

Diagram
PortFast doesn't turn STP off
PortFast doesn't turn STP off
Something plugged inWhat the PortFast port does
PC, printer, serverStays an edge port: forwards at once, no TCNs
A device sending BPDUs, without active BPDU GuardLoses operational edge status and follows active STP/RSTP rules. Configured PortFast can remain present.
A device sending BPDUs, with active BPDU GuardNormally causes the interface to become err-disabled; fix the cause before recovery.
The port becomes an 802.1Q trunkNormal PortFast doesn't work on trunks (unless portfast trunk is set)
Each item on the left, with what it means on the right.

So there are two states. The administrative state is what you configured. The operational state is what is really happening:

Illustrative BPDU-reception case · no active BPDU Guard
SW3#show spanning-tree interface Gi1/0/10 portfast
VLAN0010            disabled
spanning-tree portfast is still in the config. But a switch was connected, so PortFast is really off. The Type column no longer shows Edge.

Per port, per switch or switchport host

CommandApplies toWhen to use it
spanning-tree portfast defaultNon-trunk ports unless overriddenA reviewed edge-default policy. Exclude a non-edge interface explicitly with spanning-tree portfast disable.
spanning-tree portfastOne interfaceWhen only a few ports need it
switchport hostOne supported switch interfaceRecognise this shortcut: it can also change access/EtherChannel settings. It is not a harmless synonym for PortFast on an existing port.
Illustrative summary excerpt · separate global-default policy
SW3#show spanning-tree summary | include Portfast|PortFast
Portfast Default                        is enabled
PortFast BPDU Guard Default            is disabled
Portfast BPDU Filter Default           is disabled
This separate example has the PortFast global default enabled but guard disabled. Enabling PortFast did not automatically enable BPDU Guard. Review each policy independently.

Which ports get it, including some trunks

Endpoint trunks need a topology review. An access point can bridge wireless and wired traffic; a firewall can be transparent; a hypervisor can have several uplinks or nested bridges. Check whether traffic or BPDUs can return through another path before declaring any of them an edge.

Compare reviewed endpoint trunks with a switch uplink
Diagram
Edge ports vs switch links
Edge ports vs switch links
no PortFastDistributionAccessPCPortFastAccess pointPortFast trunkFirewallPortFast trunkHypervisorPortFast trunk

Device key: Distribution (Layer 3 switch) · Access (switch) · PC (computer) · Hypervisor (server)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

  1. 1. End devices: PCs, printers, phones and single-VLAN servers get normal PortFast.
  2. 2. Endpoint trunks need review. An AP or firewall can use several VLANs. Its operating mode and other connections decide whether this link is an edge; routed interfaces differ from transparent bridging.
  3. 3. Check the virtual switching design. A reviewed hypervisor endpoint trunk may use PortFast trunk. Do not assume every virtual switch avoids uplink-to-uplink bridging or never carries BPDUs.
  4. 4. Never between switches: skipping listening and learning there can cause short loops.
PortFast trunk labels are conditional examples. Verify each endpoint's operating mode and bridging design. The distribution uplink is a normal switch-to-switch link.

Short lab: verify one edge port

Use an isolated lab with one PC on SW3 Gi1/0/11, no bridging software or second network path, and VLAN 10 already working. Record the port configuration and global defaults. Apply only the one-port access/PortFast example.

show spanning-tree summary show spanning-tree interface GigabitEthernet1/0/11 portfast show spanning-tree vlan 10 show interfaces GigabitEthernet1/0/11 switchport

SW3, privileged EXEC. Verify protocol mode, operational edge status, forwarding state and VLAN assignment. DHCP success still depends on the upstream service.

Disconnect and reconnect only the lab PC and observe startup. Do not connect two switch ports together to demonstrate a loop. Restore recorded interface settings if this was temporary. With a global PortFast default, removing a local line can inherit that default; an explicit per-port disable is a different policy choice.

Test yourself on PortFast

Predict · scenario 1

Where should PortFast be configured?

Predict · scenario 2

PortFast is configured, BPDU Guard is not active, and the port receives a BPDU. What should you expect?

Predict · scenario 3

Besides faster startup, what else does PortFast prevent?

Sources: Cisco PortFast and BPDU Guard; Cisco PortFast scope and operational-state commands. Outputs are illustrative, not switch captures.