Description |
This article describes a change in how FortiOS compares BGP routes learned from a neighbor to those distributed from other protocols.
In firmware versions having the change, FortiOS uses original administrative distance rather than BGP weight. |
Scope | FortiOS v7.4.8, v7.6.3 and later. |
Solution |
Example Topology:
FortiOS v7.4.7 and earlier:
In this example, the static route for the remote network 10.255.250.0/24 is redistributed into BGP.
config router bgp config redistribute "static" set status enable set route-map "static-to-bgp" end end
With the default configuration, this causes an issue failing back to the primary BGP-learned route. By default, the redistributed route has a BGP weight (32768) higher than the intended primary route, which prevents the intended route from being selected if the BGP neighborship flaps. In this case, both routes are visible in the bgp network table:
get router info bgp network VRF 0 BGP table version is 3, local router ID is 10.255.255.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path * 10.255.250.0/24 10.255.108.2 0 0 0 65412 i <-/-> *> 10.255.108.3 32768 0 ? <-/1>
In these firmware versions, the issue is resolved by configuring a higher weight on the inbound BGP route-map and refreshing routes learned over BGP, see Technical Tip: BGP weight attribute in redistribution scenario.
config router route-map edit "remote-ebgp-in" config rule edit 1 set set-weight 32769 next end next end
config router bgp config neighbor edit "10.255.108.2" set route-map-in "remote-ebgp-in" next end end
execute router clear bgp ip 10.255.108.2 soft
get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path
FortiOS v7.4.8, v7.6.3, and later:
In these firmware versions, setting a weight is no longer necessary. Instead, the administrative distance from the original parent protocol is compared with the appropriate BGP administrative distance. By default, the BGP distance is 20 for EBGP and 200 for IBGP. This change is made as part of a fix for issue ID 1085314, see FortiOS v7.4.8 Release Notes | Resolved Issues.
When the BGP neighbor is down, the static route is redistributed into BGP.
get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path
When the BGP neighbor is back up, the BGP-learned route displaces the backup route in the BGP table, even though no weight is configured. This occurs because the administrative distance of the original static route is 211, so the distance 20 route learned over EBGP is preferred.
get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1
config router static edit 99 set dst 10.255.250.0 255.255.255.0 next end
Known Issue:
In FortiOS v7.4.8 and v7.6.3, there is a known issue 1171689 that causes the administrative distance of redistributed routes from dynamic routing protocols to be incorrectly considered as 20 for BGP route comparison, if there is a route-map applied in redistribution configuration. The issue is resolved in FortiOS v7.4.9 and v7.6.4.
config router bgp config redistribute "ospf" set status enable set route-map "ospf-to-bgp" end end
This may affect route selection of a previously working configuration, particularly if IBGP is in use with a custom distance. |
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.