Description |
This article describes the behavior of a FortiGate during route advertisement to an external BGP (eBGP) peer.
By default, when advertising a route to an eBGP peer, the FortiGate modifies the NEXT_HOP attribute to its IP address. This behavior ensures reachability through the advertising FortiGate.
However, when the set attribute-unchanged next-hop option is configured, the FortiGate preserves the original NEXT_HOP attribute and advertises the route without modification. This is useful in deployments where maintaining the original next-hop information is required for proper routing decisions or end-to-end path visibility. |
Scope | FortiGate. |
Solution |
Diagram: FGT1 (Port2 172.16.1.2)-------(172.16.1.1 Port2) FGT2.
FGT1 # show router bgp config redistribute "rip" FGT1 # show router static
The FortiGate modifies the NEXT_HOP attribute to its own IP address(172.16.1.2):
FGT1 # get router info bgp neighbors 172.16.1.1 advertised-routes Network Next Hop Metric LocPrf Weight RouteTag Path
The objective is to modify the NEXT_HOP attribute to 10.254.1.100 when FGT1 advertises the prefix 4.4.4.4 to its eBGP peer FGT2. By default, it is not possible.
FGT1 # show router bgp
FGT1 # get router info bgp neighbors 172.16.1.1 advertised-routes Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1
After configuring 'set attribute-unchanged next-hop', the original next hop (10.254.1.100) was advertised to the eBGP neighbor.
The next-hop can be changed to any IP address and does not need to match the static route's gateway. For example, This is also valid when advertising the network using the network statement
FGT1 # show router bgp
FGT1 # show router route-map
FGT1 # show router prefix-list
Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1 |
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.