What Are BGP States?
BGP states are the stages two routers pass through while they build a session. A peer stuck in one of them has failed at that exact step.
Border Gateway Protocol moves routes between separate networks. Before any route moves, the two routers have to agree they are talking, and the state tracks how far that agreement got.
Both ends track the session separately, so the two can disagree. One side showing Established while the other shows Active is a normal sight halfway through a failure.
OSPF runs a similar neighbor sequence inside a single network. BGP depends on a TCP connection first, and that gives its early states a different failure pattern.
How Many States Does BGP Have?
BGP has six states: Idle, Connect, Active, OpenSent, OpenConfirm and Established. You will see the sequence called the BGP finite state machine, which is RFC 4271's term for it.
Their order is worth more than their names. A session climbs through them one at a time.
Any fault drops it back toward Idle instead of holding it in place. So the state you catch is the state the session fell to, not the one it reached.
The Six BGP States in Order
Your monitoring system sees numbers here, not names. RFC 4273 numbers the six states one through six in the BGP4-MIB, so the table below carries both.
State | SNMP value | What the router is doing | What moves it forward |
Idle | 1 | Refusing all incoming connections and holding no resources for the peer | A start event, which allocates resources and opens a TCP connection |
Connect | 2 | Waiting for its outbound TCP connection to finish | TCP completes, so the router sends an OPEN message |
Active | 3 | Listening for a TCP connection from the peer after its own attempt failed | A TCP connection succeeds, or the retry timer sends it back to Connect |
OpenSent | 4 | Waiting for the peer's OPEN message after sending its own | A valid OPEN arrives, so the router replies with a KEEPALIVE |
OpenConfirm | 5 | Waiting for a KEEPALIVE or an error from the peer | A KEEPALIVE arrives and the session comes up |
Established | 6 | Exchanging UPDATE and KEEPALIVE messages with the peer | Nothing, since this is the working state |
Four of those six pass in well under a second on a healthy session. A 60-second poll will never once catch a router in Connect, OpenSent or OpenConfirm.
That's why the state you find tells you so much. A session parked anywhere other than Established has stopped at the exact step that failed.
Why Does BGP Show the Active State?
Active means the router's own TCP connection attempt failed. It has fallen back to listening, in the hope that the peer opens one the other way.
That name has wasted more troubleshooting hours than any other word in BGP. It says nothing at all about the health of the session.
This catches people out constantly. A working session never sits in Active, so finding it there counts as a fault report.
Most Active-state problems live below BGP. The router cannot reach its peer over TCP.
So the session never gets as far as exchanging an OPEN message. BGP itself has nothing to report yet.
A session cycling between Connect and Active points at the same root cause. The retry timer expires in Active and sends it to Connect.
The next attempt fails there and returns it to Active. That loop repeats until someone fixes the path.
What Does a Stuck BGP State Tell You?
A stuck session is better news than a flapping one, because it names the step that failed. The table below maps each state to what usually put it there.
State you find | What it means | Usual cause |
Idle | The router is not trying to form the session | The neighbor is shut down, or no route exists to the peer address |
Idle, with a timer counting | Repeated failures have pushed the router into a backoff | Whatever broke the earlier attempts is still broken |
Connect and Active, cycling | TCP never completes in either direction | An ACL or firewall blocking port 179, a wrong peer address, or a missing multihop setting |
Active, parked | The outbound attempt failed and no inbound one arrived | Often an MD5 password mismatch, which stops TCP from establishing |
OpenSent | TCP works, and the peer rejected what it received | An AS number mismatch, or a router ID both sides claim |
OpenConfirm | The OPEN exchange worked and no KEEPALIVE followed | A hold time of zero on one side, or a capability the peer refuses |
The split between Active and OpenSent does the most work here. Active says the two routers never spoke, while OpenSent says they spoke and disagreed.
We check that split first on any peer that won't come up. Active sends you to the firewall and the routing table, while OpenSent sends you to the AS numbers in the config.
Both look identical in a dashboard that reports only up or down. That is where most network troubleshooting starts and stalls.
Which TCP Port and Timers Does BGP Use?
BGP listens on TCP port 179. Block that port anywhere along the path and the session never leaves Connect or Active, whatever the BGP config says.
Three timers then set the patience at each stage.
Timer | Suggested default | What it controls |
ConnectRetryTime | 120 seconds | How long the router waits before retrying a failed TCP connection |
HoldTime | 90 seconds | How long silence from the peer can last before the session drops |
KeepaliveTime | 30 seconds | How often KEEPALIVE messages go out, set at a third of the hold time |
RFC 4271 gives those as suggested values, and vendors ship them as defaults. The two sides never have to agree beforehand, because each offers a hold time and the smaller one wins.
So a peer configured for 30 seconds pulls your 90 down to 30. Check both ends before blaming a flap on the link.
None of this runs until TCP is up. A missed SYN or a reset in those TCP flags leaves BGP with nothing to do, and the state machine never starts.
How Do You Check BGP State?
Every platform reports peer state in its BGP summary output. The command differs by vendor, though the state names do not.
Platform | Command | Where the state appears |
Cisco IOS and IOS-XE | show ip bgp summary | The State/PfxRcd column, one row per peer |
Juniper Junos | show bgp summary | The State column, with Establ for a working session |
Arista EOS | show ip bgp summary | The State column |
FRRouting | show bgp summary, inside vtysh | The State/PfxRcd column |
On Cisco and FRRouting that column does something worth knowing. Once a session reaches Established it stops printing a state name and prints the prefix count instead.
So a number in that column means the session is up. A word in it means the session is not, and 0 means it came up and received nothing.
Add the neighbor address to the command for the full picture on one peer. That output carries the session reset count and the last error code, which the BGP4-MIB exposes as bgpPeerLastError.
SNMP polling won't give you either one. Both matter when a session comes up and drops repeatedly.
Why BGP States Matter for Network Monitoring
BGP state is the earliest signal that an external connection is failing. A peer dropping out of Established takes its routes with it.
Traffic either reroutes down a worse path or stops. Both happen before anyone opens a ticket.
The numbering in the BGP4-MIB is what makes this monitorable. The states run from one to six in order.
Any move to a lower number means the session went backward. Every BGP alert worth having is built on that one comparison.
The SNMP trap for that event is named bgpBackwardTransNotification. Its partner, bgpEstablishedNotification, fires when the peer comes back up.
Together the two give you the full shape of a flap. Neither one alone tells you a session recovered.
Traps catch what polling misses. A session can drop and recover inside your polling interval.
The polled value shows nothing at all. Both traps record the flap clearly.
What to Alert On
Alert on the backward transition trap rather than the state value alone. Pair it with the session reset counter.
A peer that flaps ten times an hour never looks broken in a single check. The counter is the only place that history shows up.
Established on its own is a weak signal of health. A session can sit in Established and receive zero prefixes, which passes a state check and routes no traffic.
So track the prefix count beside the state. Pull both into router monitoring.
A peer going quiet then raises an alert, not a surprise later. That is the difference between noticing a dead peer and discovering one.
Explore More IT Terms
Browse our comprehensive IT glossary to learn more about technology terminology.