| Description | This article describes BGP Neighbor Adjacency States. |
| Scope | FortiGate. |
| Solution |
For a more technical information on the operation of the BGP FSM, see Section 8 of the BGP-4 RFC 4271.
BGP establishes a TCP connection with peers or adjacent routers. A Finite State Machine (FSM) is used by BGP to keep track of each BGP neighbor and the operational condition. The following states are possible for the BGP session to report:
get router info bgp summary VRF 0 BGP router identifier 10.255.255.1, local AS number 65411 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd Total number of neighbors 1
Idle: This is the initial state of the BGP FSM. No BGP connections are initiated, all existing connections are closed, and all incoming connections for this neighbor are refused.
When a start event occurs, BGP resources will be initiated, and the FSM will transition to the Connect state. Typically, this is done automatically by the FSM.
config router bgp config neighbor edit <neighbor IP address> set shutdown {enable | disable} next end end
Connect: In this state, FortiOS initiates a BGP connection to the neighbor.
The device uses a dynamic source port, but the destination port is always TCP 179. Similar to the Active state, BGP FSM is also listening for TCP connections from the remote peer while in the Connect state.
In this state, BGP is listening for a TCP connection.
The Active state is reached if there is a timeout or error in establishing the TCP three-way handshake. While in the Active state, the BGP process will not attempt to initiate a TCP connection with the neighbor. Once the ConnectRetryTimer expires, the BGP FSM will move back to the Connect state. config router bgp config neighbor edit <neighbor IP address> set passive {enable | disable} next end end
OpenSent: In this state, BGP is waiting for an OPEN message from the remote neighbor.
If a keepalive message is received before any OPEN message is received from the remote side, a Notification message is sent to the neighbor and the local FSM moves to the Idle state.
If there is an error in the received Open message, a Notification message is sent to the neighbor and the local FSM moves to the Idle state.
OpenConfirm: In this state, BGP has received a valid OPEN message from the neighbor and is waiting for a Keepalive message acknowledging its own Open message.
When a keep-alive message is received, it moves to the Established state, but if a Notification message is received, it moves to the Idle state.
Established: In this state, the connection is fully established, and update messages with routing information are exchanged.
When a Keepalive or an Update message is received, the Hold timer will reset. If a Notification message is received, the connection will close and BGP will move to the Idle state.
Note:
|
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.