Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Finite State Machine Reference

Direct 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.

When to use this

Use it when show ip bgp summary shows a word — Idle, Connect, Active, OpenSent — instead of a prefix count, and you need to know what that state says about the fault.

First 30 seconds

1. show ip bgp summary — State/PfxRcd column; a number means Established.

2. Idle → no route/config or admin down; Active → TCP to port 179 failing.

3. show ip bgp neighbors <ip> | include state|Last reset for the reset reason.

Operational verification

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

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · Cisco IOS XE · Cisco IOS / IOS XE
Key commandshow bgp ipv4 unicast summary
Scope / prerequisiteUse it when show ip bgp summary shows a word — Idle, Connect, Active, OpenSent — instead of a prefix count, and you nee…
Show · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show bgp ipv4 unicast summary

Look first: peer, AS, state/PfxRcd, uptime

Healthy: Expected peer is Established and prefix count is plausible.

Warning: Idle/Active/Open* state, repeated uptime reset or unexpected prefix count.

Does not prove: Established does not prove desired prefixes pass policy or win best path.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational verification and known-good state Verify boundary
show ip bgp summary
show ip bgp neighbors 192.0.2.2 | include state|Last reset|hold
show ip route 192.0.2.2
ping 192.0.2.2 source Loopback0

The summary shows state and up/down time for every neighbour. The neighbour detail shows the current state, the reason for the last reset and the negotiated timers. The route lookup and the ping — sourced from the address the session uses — test whether the neighbour's address is reachable at all.

Known-good: the last summary column is a number, the up time keeps growing, and the last reset is old or never.

Step 2 Failure signatures and troubleshooting branches Narrow the fault
  • Stuck in Idle. The neighbour is administratively shut down, or there is no route to its address.
  • Stuck in Active, or alternating Active and Connect. TCP port 179 does not get through: wrong neighbour address, an ACL, a missing update-source so the session comes from an address the neighbour does not expect, eBGP neighbours that are not directly connected without ebgp-multihop, or a password mismatch.
  • Reaches OpenSent, then back to Idle or Active. The OPEN was rejected — nearly always the wrong remote-as. The log names the reason.
  • Established, then down again every few minutes. Keepalives are lost: an unstable path, or the session depends on a route it learns through itself.
  • Established with 0 prefixes. The session is fine; the problem is in what is advertised or filtered.
  • Up time keeps resetting. Read the last reset reason before changing anything.
Step 3 When the problem is really fixed Narrow the fault
  • The neighbour shows a prefix count, not a state name, in show ip bgp summary.
  • The up time grows steadily and exceeds several hold times.
  • The last reset reason is understood.
  • The expected prefixes are received.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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.

Key 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>.

ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

A BGP session goes through six states on its way up: Idle, Connect, Active, OpenSent, OpenConfirm and Established. The first three are about getting a TCP connection to the neighbour, the next two about agreeing on the BGP parameters, and only in Established are routes exchanged.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

The state a session is stuck in points to where the problem is. A session that never leaves Idle or Active has a reachability or TCP problem; one that reaches OpenSent and falls back has a parameter mismatch; one that reaches Established and drops again has a stability problem. Reading the state first saves checking everything else.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

The BGP finite state machine

A BGP session goes through six states, and knowing which one it is stuck in narrows the problem down immediately. RFC 4271 defines them:

  • Idle: refuses connections. A start event moves it towards Connect.
  • Connect: waits for the TCP connection to complete.
  • Active: listens for an incoming connection, and retries Connect when the ConnectRetry timer expires.
  • OpenSent: has sent OPEN and waits for the peer's OPEN.
  • OpenConfirm: has accepted the OPEN and waits for a KEEPALIVE.
  • Established: UPDATEs flow.

Any error sends a NOTIFICATION and returns the session to Idle.

States and their usual causes

Stuck inMeaningCheck
IdleNot trying, or backing off after errorsneighbor shutdown, max-prefix shutdown, missing route to the peer
ConnectTCP SYN sent, no answer yetReachability, ACLs, the source address
ActiveConnection attempts failing; waiting or listeningThe peer's configuration (does it have our address?), TCP 179 filtered, wrong update-source
OpenSentOPEN sent, no valid OPEN backAS number mismatch, OPEN errors
OpenConfirmWaiting for KEEPALIVEHold time or capability problems (short-lived)
EstablishedUpLook at routes and policy instead

Timers (RFC 4271)

TimerNote
ConnectRetryLocal choice; must allow TCP to complete (IOS uses about 120 s)
Hold timer during Connect/ActiveA large value, 4 minutes suggested
Negotiated hold timeThe lower of the two OPEN values; 0 or at least 3 s
KeepaliveTypically a third of the hold time

"Active" is not good news

Despite its name, Active means the session is down and the router is waiting for or retrying a connection. A peer that stays in Active usually doesn't have this router configured as a neighbour, or the TCP connection is blocked.

R1# show bgp ipv4 unicast summary | begin Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
203.0.113.1     4 64500    4410    4401       12    0    0 3d02h            1
198.51.100.9    4 64501       0       5        1    0    0 00:02:10 Active
10.255.0.2      4 65010       0       0        1    0    0 never    Idle
R1# show bgp ipv4 unicast neighbors 198.51.100.9 | include BGP state|Last reset|Connections|Foreign host
R1# show tcp brief | include 179
R1# debug ip bgp 198.51.100.9 events

Reading the summary

198.51.100.9 has been in Active for two minutes, with 5 messages sent and none received. That points to the peer refusing or never answering. 10.255.0.2 shows Idle and never, so the session hasn't been attempted, for example because it is shut down or there is no route to the peer's address.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics and state ownership

Idle — BGP is not trying, or is waiting to try again. Idle (Admin) means the neighbour is shut down in the configuration. Plain Idle often means there is no route to the neighbour's address.

Connect — BGP has started a TCP connection to port 179 and is waiting for it to complete.

Active — the TCP connection did not succeed and BGP is trying again, and listening for the neighbour to connect instead. Despite the name, Active is a failing state: a session that stays there cannot reach the neighbour over TCP.

OpenSent — TCP is up and the router has sent its OPEN message with its AS number, hold time, router ID and capabilities, and waits for the neighbour's.

OpenConfirm — the neighbour's OPEN was acceptable; the router waits for the first keepalive.

Established — the session is up. Routes are exchanged with UPDATE messages, and keepalives hold the session open. If none arrives within the hold time (180 seconds by default, keepalives every 60), the session is torn down and starts again from Idle.

In show ip bgp summary the last column shows the state name while the session is down, and a number — the count of prefixes received — once it is Established.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS / IOS XE RFC 4271Hold a neighbour down on purpose while working on it, then release it

Assumptions: Lab addressing; local AS 65000; loopbacks carried in the IGP.

router bgp 65000
 neighbor 192.0.2.6 shutdown
! shows as Idle (Admin); release with:
 no neighbor 192.0.2.6 shutdown

Expected output

Cisco IOS / IOS XE RFC 4271show ip bgp summary

Expected state: One healthy neighbour next to two that are not Established.

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.0.2.2       4        65010     210     205       42    0    0 03:12:44       12
192.0.2.6       4        65020       0       0        1    0    0 00:04:31 Active
10.0.0.3        4        65000       0       0        1    0    0 never    Idle (Admin)
! Illustrative output, not captured Evidence.
192.0.2.2 is Established (12 prefixes). 192.0.2.6 has been retrying TCP for four and a half minutes: check the route to the peer, the source address and any ACL on port 179. 10.0.0.3 is administratively shut down.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 4271

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → BGP Finite State Machine Reference. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
bgp statesbgp activebgp idleopensentopenconfirmestablishedBGP stuck in ActiveBGP stuck activeBGP neighbor stuck in Active
Embedded reference data

Quick lookup tables

BGP Finite State Machine Reference operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

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
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

BGP FSM Fast Check

State → boundary.

Idle → reset/start

Connect → TCP pending

Active → TCP retry; usually transport/reachability issue

OpenSent → OPEN negotiation

OpenConfirm → KEEPALIVE confirmation

Established → UPDATE exchange possible

Verification: route to peer → ARP/ND → TCP/179 → OPEN → Established.

Confirmation

Confirm action

Continue?