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.
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. Both PCs boot. Both send a DHCP request as soon as their cable is connected.
- 2. PC 2's request can leave. Its PortFast port is forwarding; DHCP and other policy checks must still succeed.
- 3. PC 1 waits. Its port is still listening, then learning. It only forwards after about 30 s.
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 portfastSW3 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 defaultAlternative 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 trunkSeparate 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
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.
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
10:05:00.100: STP: VLAN0010 Gi1/0/10 ->jump to forwarding from blocking
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.
| Something plugged in | What the PortFast port does |
|---|---|
| PC, printer, server | Stays an edge port: forwards at once, no TCNs |
| A device sending BPDUs, without active BPDU Guard | Loses operational edge status and follows active STP/RSTP rules. Configured PortFast can remain present. |
| A device sending BPDUs, with active BPDU Guard | Normally causes the interface to become err-disabled; fix the cause before recovery. |
| The port becomes an 802.1Q trunk | Normal PortFast doesn't work on trunks (unless portfast trunk is set) |
So there are two states. The administrative state is what you configured. The operational state is what is really happening:
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
| Command | Applies to | When to use it |
|---|---|---|
spanning-tree portfast default | Non-trunk ports unless overridden | A reviewed edge-default policy. Exclude a non-edge interface explicitly with spanning-tree portfast disable. |
spanning-tree portfast | One interface | When only a few ports need it |
switchport host | One supported switch interface | Recognise this shortcut: it can also change access/EtherChannel settings. It is not a harmless synonym for PortFast on an existing port. |
SW3#show spanning-tree summary | include Portfast|PortFast Portfast Default is enabled PortFast BPDU Guard Default is disabled Portfast BPDU Filter Default is disabled
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
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. End devices: PCs, printers, phones and single-VLAN servers get normal PortFast.
- 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. 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. Never between switches: skipping listening and learning there can cause short loops.
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 switchportSW3, 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
Where should PortFast be configured?
PortFast is configured, BPDU Guard is not active, and the port receives a BPDU. What should you expect?
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.