Clearing BGP on a FortiGate can mean refreshing routes, resetting one neighbor, or restarting every BGP peering on the device. The right command depends on what you need to fix. A soft refresh is generally the least disruptive option, while clearing a BGP neighbor can briefly interrupt routing and cause traffic to use a backup path—or become unavailable. This guide explains how to check BGP status, clear a specific FortiGate neighbor, refresh routes, and verify the result safely.
What Does “Clear BGP” Mean on a FortiGate?
Border Gateway Protocol (BGP) exchanges routing information between routers and networks. On a FortiGate, clearing BGP usually means asking the firewall to refresh BGP information or to reset a BGP session. These actions are not identical:
- Soft refresh: Refreshes route information without intentionally tearing down the TCP session. It is usually the best first step when you have changed routing policy or want to request updated routes.
- Neighbor reset: Restarts the BGP session with one peer. Routes learned through that neighbor may be withdrawn until the session comes back up.
- Clear all: Resets all BGP peerings on the FortiGate. This can affect multiple routes and should be used only when you intend to reset every neighbor.
Command details can vary by FortiOS release and configuration. Before running a command, check the CLI options available on your device with the built-in help. If the FortiGate is running multiple VDOMs, make sure you are working in the VDOM that owns the BGP configuration.
Before You Clear a BGP Neighbor
First, confirm the problem and identify the exact peer. A BGP reset may trigger route withdrawal, route recalculation, and a temporary change in the path used for traffic. If the neighbor is carrying production routes, schedule the change appropriately and make sure an alternate path is available where possible.
Check the current BGP summary from the FortiGate CLI:
get router info bgp summary
The summary typically shows each neighbor’s address, BGP state, and information about received or advertised prefixes. A neighbor in the Established state has an active BGP session. States such as Idle, Active, or Connect can indicate that the session is not established, although the cause may be connectivity, configuration, or peer-side behavior—not a need to clear BGP.
For more detail about a peer, use:
get router info bgp neighbors
You can also inspect the BGP configuration to confirm the peer address and related settings:
show router bgp
Record the neighbor’s current state and relevant routes before making a change. This gives you a useful comparison after the refresh or reset.
How to Soft-Clear or Refresh a BGP Neighbor
If your goal is to refresh information from one peer without deliberately restarting its session, try a soft clear for that neighbor. The commonly used FortiGate command format is:
execute router clear bgp ip <neighbor-ip> soft
For example, to request a soft refresh from the peer at 192.0.2.2, enter:
execute router clear bgp ip 192.0.2.2 soft
Replace the example address with the actual IP address of your BGP neighbor. The soft option is designed to refresh routing information without performing the same full session teardown as a hard reset. The exact direction and behavior of a soft refresh can depend on FortiOS version, peer capabilities, and configuration. If your CLI offers additional options, read the help output and confirm whether you need to refresh routes received from the peer, routes advertised to it, or both.
A soft refresh is often appropriate after a routing-policy change, such as an update to a prefix list or route map, when you want the policy to be applied to BGP routes again. However, a soft clear cannot fix every problem. If the BGP session itself is stuck or the peer is unreachable, investigate the underlying issue rather than repeatedly requesting a refresh.
How to Reset One BGP Neighbor
To restart just one peer, use the neighbor-specific clear command without the soft option:
execute router clear bgp ip <neighbor-ip>
For example:
execute router clear bgp ip 192.0.2.2
This resets the BGP session with the specified IPv4 neighbor. The FortiGate and peer must establish the session again, so routes learned through that peer can be withdrawn and relearned during the process. The disruption may be brief, but the impact depends on how many routes are involved, how quickly the session reconnects, and whether another route is available.
Use this option when you have a specific reason to restart the session—for example, after a session appears unresponsive and you have already checked connectivity and configuration. Avoid using it as a routine way to apply policy changes when a supported soft refresh will do.
How to Clear All BGP Neighbors
If you intentionally need to reset every BGP peer on the FortiGate, the command commonly used is:
execute router clear bgp all
This can interrupt all BGP sessions at once. Routes learned from those peers may disappear until the sessions re-establish, potentially affecting traffic across multiple networks. Do not use the all-neighbor command just to troubleshoot one peer or refresh one route. Confirm the scope of the command on your FortiOS version before running it, especially on a production firewall.
If your environment uses multiple VDOMs, check that you are in the correct routing context. A command run in the wrong context may not affect the peer you intended—or may affect a different routing environment than expected.
Clearing an IPv6 BGP Neighbor
For IPv6 BGP peers, FortiOS may provide an IPv6-specific command form. A commonly available format is:
execute router clear bgp ipv6 <neighbor-ipv6>
Some releases also support a soft option for IPv6 neighbors. Because the syntax can differ across FortiOS versions, use CLI completion or help before running the command. At the prompt, try entering the command prefix followed by ? to see the options accepted by your device. Make sure you enter the neighbor’s IPv6 address in the format expected by the CLI.
How to Verify the BGP Clear Worked
After running a soft refresh or reset, check the BGP summary again:
get router info bgp summary
For a neighbor reset, look for the peer to return to Established. It may pass through other BGP states while the session reconnects. For a soft refresh, confirm that the expected routes or prefix counts have updated, and check the relevant neighbor details if needed:
get router info bgp neighbors
Then confirm that the routes you care about are present in the routing table and that traffic is following the intended path. A BGP session being Established does not, by itself, prove that the correct routes are being accepted, installed, or advertised. If a route is missing, review the FortiGate’s BGP policies and filters, the peer’s advertisements, and the route’s installation conditions.
Common Reasons a BGP Clear Does Not Solve the Problem
Clearing BGP only refreshes or restarts a session. If the cause remains, the issue is likely to return. Check these common areas:
- Connectivity to the peer: Confirm that the FortiGate can reach the neighbor using the expected interface and source address. Check routing, link state, and any intermediate firewall rules.
- Peer configuration: Verify the remote peer address, autonomous system number, authentication settings, and any required update-source or multihop configuration.
- TCP port 179: BGP uses TCP port 179. Confirm that relevant security policies and upstream devices allow the session in the required direction.
- Routing policy: Review prefix lists, route maps, filters, and other import or export rules that may reject or change routes.
- Peer-side status: Ask the remote administrator to check the other router’s BGP state and logs. A local clear cannot correct a problem on the remote router.
- FortiOS syntax or context: Confirm the command supported by your software release and that you are operating in the correct VDOM.
If the session repeatedly resets, investigate the reason for the resets rather than clearing it again. Look for changes in reachability, configuration, or peer behavior, and use your organization’s normal troubleshooting and change-control process.
Safe BGP Clearing Practices
Use the narrowest action that meets your goal. Start by identifying the affected neighbor, then prefer a soft refresh when the session is healthy and you only need to update routing information. Reset one neighbor only when you need to restart that specific session. Reserve a clear-all operation for planned situations where resetting every BGP peer is acceptable.
Before making a production change, save or document the current configuration, check for alternate routes, and notify affected teams if the potential impact warrants it. Afterward, verify both the BGP session and the actual routes used for forwarding. If the command’s behavior is unclear, consult the FortiOS CLI help and documentation for your exact release rather than relying on syntax from a different version.
Conclusion
To clear BGP on a FortiGate, use a neighbor-specific command whenever possible. A soft clear, commonly entered as execute router clear bgp ip <neighbor-ip> soft, is intended to refresh routing information without a full session reset. To restart one peer, use execute router clear bgp ip <neighbor-ip>; to reset all peers, use execute router clear bgp all only when you understand the wider impact. Check the syntax supported by your FortiOS release, verify the correct VDOM, and confirm that the session and expected routes recover after the operation.
Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.