Technical Tip: Understanding unexpected Next-Hop behavior in FortiGate ADVPN with BGP
| Description | This article describes that in FortiGate Auto-Discovery VPN (ADVPN) setups using BGP, an 'unexpected' next-hop behavior can be observed where the next-hop IP in received routes does not match the advertising neighbor (typically the hub). Instead, it remains the IP of the originating spoke. |
| Scope | FortiGate. |
| Solution | In a hub-and-spoke ADVPN topology with BGP (often iBGP in the same AS), hubs commonly act as route reflectors (RRs) to propagate routes between spokes without requiring a full-mesh peering.
By default, when a hub reflects a route from one spoke to another, it preserves the original next-hop IP (the originating spoke's tunnel IP) rather than rewriting it to its own IP.
This is intentional in ADVPN to enable spoke-to-spoke shortcuts: Traffic initially flows through the hub, but upon detection, a direct IPsec tunnel forms between spokes, bypassing the hub.
This preservation can appear 'unexpected' if it anticipates hub-centric routing, where the hub's IP should always be the next-hop. In iBGP, next-hops are not automatically changed (unlike eBGP), and standard next-hop-self does not apply to reflected routes, only to local or eBGP-learned ones.
As a result, commands like get router info bgp neighbors received-routes may show next-hops as spoke IPs, even though the routes are advertised by the hub.
In this diagram:
Configuration Steps Leading to the Issue. On the hub:
Step 1: Set Up IPsec Tunnels for ADVPN.
config vpn ipsec phase1-interface edit "ADVPN-Hub"
On spokes (e.g., Spoke1 and Spoke2), use similar configs with auto-discovery-receiver enabled.
Step 2: Configure BGP on the Hub as a Route Reflector.
config router bgp
Step 3: Configure BGP on Spokes
config router bgp config network edit 1
Verification: This default config leads to the behavior, as 'next-hop-self' does not modify reflected iBGP routes. Use 'get router info bgp network' on spokes to observe preserved next-hops (e.g., Spoke1 sees Spoke2's route with Spoke2's IP as next-hop, advertised via hub).
To modify this default behavior, refer to the following article: Technical Tip: Explanation of 'set next-hop-self-rr enable'
Note that the example above refers to an iBGP scenario, which is the expected behavior in an ADVPN environment, unless the hub needs to control routing as described in Technical Tip: How to modify BGP next hop for route reflector peering. However, in deployments where both eBGP and iBGP are involved, follow the guidance in Technical Tip: How to modify BGP next hop for route reflector peering, and ensure that the next-hop-self command is configured appropriately based on the specific topology. |
