BGP neighbour states, messages and troubleshooting sessions and missing routes
In short: A BGP session moves through six states, and the state it is stuck in tells you what is wrong: Active points to TCP reachability, while a session that bounces after OpenSent usually has a parameter mismatch. Once Established, routes can still go missing because of next hops, filters or the iBGP rule. Route refresh lets you apply new policy without resetting the session.
The neighbour states
| State | What is happening |
|---|---|
| Idle | The session is not started, or was reset after an error. BGP waits, then tries again. |
| Connect | BGP is trying to open the TCP connection to port 179. |
| Active | The TCP attempt failed and BGP is trying again. Despite the name, this is not good news. |
| OpenSent | TCP is up and an OPEN message has been sent. |
| OpenConfirm | An acceptable OPEN was received; waiting for a KEEPALIVE. |
| Established | The session is up and UPDATE messages are exchanged. |
BGP messages
- OPEN: version, ASN, hold time, router ID and capabilities such as 4-byte ASNs, multiprotocol support and route refresh.
- UPDATE: new routes with their attributes, and withdrawn routes.
- KEEPALIVE: sent periodically (every 60 seconds on Cisco by default) so the peer knows the session is alive. The hold time defaults to 180 seconds.
- NOTIFICATION: reports an error and closes the session, with a code such as "bad peer AS" or "hold timer expired".
- ROUTE-REFRESH (RFC 2918): asks the peer to resend all its routes.
Active and passive roles
Both peers normally try to open the TCP connection. If both attempts succeed, BGP keeps the connection opened by the router with the higher router ID and closes the other. You can make one side wait for the other with neighbor x transport connection-mode passive, which helps when one side sits behind a firewall that only allows connections in one direction. show ip bgp neighbors shows which side opened the session: one uses port 179 locally, the other a random high port.
When the session will not come up
- Reachability: ping the configured neighbour address from the source address you use. Stuck in Active nearly always means TCP 179 cannot connect.
- Addresses: each side must point at the address the other uses as its source. For loopback peering, check
update-source. - TTL: eBGP to a non-adjacent address needs multihop or disable-connected-check.
- Filters: an ACL or firewall may block TCP 179 in one direction.
- AS numbers: a wrong
remote-ascauses a NOTIFICATION with "bad peer AS"; the session reaches OpenSent and then resets. - Authentication: mismatched MD5 passwords leave TCP failing silently; the router logs invalid MD5 digests.
- Router ID: two routers with the same router ID cannot peer.
show ip bgp summary
show ip bgp neighbors 198.51.100.1
debug ip bgp 198.51.100.1 events
When routes are missing
An Established session does not guarantee routes. Check, in order: is the prefix in the sender's BGP table and marked best; does the network statement match the routing table exactly; is the next hop reachable on the receiver; is an inbound or outbound filter or route map dropping it; and, for iBGP, did the route come from another iBGP peer (which is not passed on)? show ip bgp neighbors x advertised-routes on the sender and received-routes or routes on the receiver show where it disappears.
Applying policy changes: soft reconfiguration and route refresh
Route maps and filters only affect new updates. A hard reset with clear ip bgp x tears the session down and disrupts traffic. Better options are soft reconfiguration inbound, which keeps an unfiltered copy of everything received (using extra memory), or the route refresh capability, which asks the peer to resend its routes. Nearly every modern router supports route refresh, so clear ip bgp x soft in works without storing extra copies.
Real-world example: a university's new backup link to a research network stayed in Active for hours. Ping between the peer addresses worked, but show ip bgp neighbors showed no TCP connection at all. The firewall in the path allowed TCP 179 only from the research network inwards, while the research network had configured its router as passive, waiting for the university to connect first. Neither side could open the session. The engineer added a firewall rule allowing the university router to connect out to the peer address on TCP 179, and the session reached Established within seconds.
Practice
A neighbour is stuck in Active. What is the most likely cause?
Which message closes a BGP session when an error is detected?
How can you apply a new inbound route map without resetting the session?
Key takeaways
- BGP states: Idle, Connect, Active, OpenSent, OpenConfirm, Established.
- Active means TCP keeps failing; check reachability, source addresses, TTL and filters.
- Messages: OPEN, UPDATE, KEEPALIVE, NOTIFICATION and ROUTE-REFRESH.
- Established sessions can still lose routes to next-hop, filter or iBGP rules.
- Use route refresh (soft clear) instead of hard resets when policy changes.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.