Pcornel
Networking · Routing › BGP › BGP Fundamentals

BGP Finite State Machine Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=213

Back to the Topic

Answer

The BGP finite state machine shows how a session comes up: Idle → Connect → Active (retrying TCP) → OpenSent → OpenConfirm → Established. A peer stuck in Active or Idle usually has a TCP, reachability or configuration problem.

Remember

Idle: not trying (no route to the peer, neighbor shutdown, or waiting after an error). Connect/Active: trying to open TCP — Active means the attempts are failing, not that the session works. OpenSent/OpenConfirm: TCP is up and the OPEN messages are being checked; flapping between Active and OpenSent points to a rejected OPEN (wrong AS, authentication). Only Established exchanges routes.

First checks

show ip bgp summary → the state word and Up/Down time. show ip bgp neighbors <ip> | include BGP state|Last reset → why it last went down. show tcp brief | include 179 → is there a TCP session at all. ping <peer> source <local peering address>.

Commands

show bgp ipv4 unicast summary
BGP peer state and prefix counts.
show ip bgp summary

Verify in this order

Idle → route to peer exists → Connect: TCP 179 attempt → fails: Active (retry) → TCP up: OpenSent → OPEN accepted: OpenConfirm → keepalive: Established → stuck in Active = reachability/source/ACL; bouncing at OpenSent = AS or authentication

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

BGP Finite State Machine Reference operational reference

BoundaryKnown-good for BGP Finite State Machine ReferenceSuspicious signatureNext proof
Input/sessionCorrect peer, source, AF and route contextSession/source/input state disagreesExact peer/source/prefix detail
Policy/protocolBGP finite-state progression from Idle through Connect, Active, OpenSent and OpenConfirm to Established, with transport, OPEN negotiation and reset-reason boundaries kept separate matches intended designpersistent Active because TCP cannot complete, repeated OpenSent/OpenConfirm resets from ASN/authentication/capability disagreement, short Established uptime caused by transport instability, or an operator clearing the neighbor without preserving the reset reason and first failed state transitionCompare policy/attributes/propagation
Route/forwardingExpected result reaches RIB/FIBControl-plane state exists but installed path disagreesRIB/FIB/CEF + next-hop proof
ClosureOriginal workload passes for explained reasonSymptom moved, was bypassed or state was forcedRegression/failover test

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=213

Confirmation

Confirm action

Continue?