July 8, 2023

BGP Neighbor Adjacency States: From IDLE to ESTABLISHED

2 min read

BGP requires manual configuration of neighbors. Once neighbors are manually configured, it goes through 6 states until it is fully established. Knowing these states would help us determine the stage our connection is currently in. It is also very important in troubleshooting as it helps us understand what went wrong during adjacency.

BGP Neighbor Adjacency States:

1. IDLE – This is normally can be seen if BGP is down / administratively down or just waiting for the next attempt. At this stage, no BGP incoming sessions are permitted.

My BGP is established between Culloden and Stirling sites and Culloden and Fyvie sites. But when I shut down s2/2 link between Culloden and Fyvie, my BGP went to IDLE state.

Culloden(config)#int s2/2
Culloden(config-if)#shut
Culloden(config-if)#end

2. CONNECT – This is when BGP starts to do the TCP connection (TCP three-way handshake). Either of the BGP neighbors will initiate the BGP session. Once completed, it jumps towards the OPENSENT state. However, if there is a problem, it goes to ACTIVE state.

3. ACTIVE – At this stage, TCP connection is completed but no BGP messages have been sent to the BGP neighbor yet. There are many reasons why BGP is stuck in ACTIVE state. Usually, there are configuration issues that stop the BGP connection from getting established. It can be a wrong AS, misconfigured local IP / peer IP address, authentication issues, and others.

OPENSENT – BGP Open message is already been sent to the peer but not yet received to the other end. You won’t usually see BGP stuck in OPENSENT state. It will immediately toggle to OPENCONFIRM state and ESTABLISHED states.

5. OPENCONFIRM – BGP Open message and keepalive has been sent and received. It won’t take long until it goes to the ESTABLISHED state.

6. ESTABLISHED – Once all the BGP requirements of establishing neighbor adjacency are met, it goes to the ESTABLISHED state. You will see prefixes Once adjacency is established between BGP neighbors, they are going to start exchanging routing information.

Putting back my s2/2 link up, makes my BGP back to ESTABLISHED state:

Culloden(config)#int s2/2
Culloden(config-if)#no shut
Culloden(config-if)#end
Culloden#

Leave a Reply