Technical Tip: Wrong route-tag added to BGP routes redistributed from OSPF
| Description | This article describes an issue where OSPF routes redistributed into BGP using a route-map with high route-tag values (for example, greater than 2147483647) do not appear with the correct route-tag in the BGP RIB. As a result, the expected tag value may be altered or not reflected properly, potentially impacting route filtering or policy decisions that rely on these tags. |
| Scope | FortiOS. |
| Solution | When redistributing OSPF routes into BGP on FortiGate, users may encounter problems where route-tags set via a route-map do not appear as expected in the BGP Routing Information Base (RIB). This can impact route selection, particularly in deployments where route-tag values are used to distinguish and prefer routes.
The issue occurs when using route-tag values close to the maximum unsigned integer limit (4294967295), which leads to incorrect backend processing in route-maps.
A prefix, 10.123.0.0/16, learned via OSPF with route-tag 4294967295 is redistributed into BGP with an incorrect tag (for example, 4294967223).
FortiGate is receiving OSPF external route with route-tag value 4294967295.
get router info ospf database adv-router x.x.x.x ..... AS External Link States By default, the OSPF route-tag is automatically redistributed into the BGP RIB. In this scenario, an inbound route-map was applied to explicitly set the tags.
Example: Route-map configuration
config router route-map edit "Out_BGP"
Example: Redistribution configuration.
config router bgp config redistribute "ospf" set route-map Out_BGP set status enable end end
When checking the BGP RIB, the redistributed OSPF route for 10.123.0.0/16 incorrectly shows a route-tag of 4294967223 instead of 4294967295.
get router info bgp network 10.123.0.0/16
Workaround:
This issue will be fixed in future versions of FortiOS (starting from 7.4.10 or higher). |
