Skip to main content
rito
Staff
Staff
March 17, 2026

Technical Tip: BGP MED Values of 2147483648 or higher cannot be advertised in FortiGate

  • March 17, 2026
  • 0 replies
  • 211 views
Description This article describes that the practical range of BGP MED values that FortiGate can advertise is limited to 0 to 2,147,483,647 (2^31-1).
Scope FortiGate v7.6.6 GA and earlier.
Solution

The BGP Multi Exit Discriminator (MED) is defined as a 32-bit unsigned integer in RFC 4271.
FortiGate also allows MED values in the range 0 to 4,294,967,295 to be configured using a route-map.
However, the FortiGate implementation handles MED values only within the range of a 32‑bit signed integer.
As a result, the following behavior has been observed on FortiGate:

  • 0 to 2,147,483,647 (2^31‑1): Advertised correctly.
  • 2,147,483,648 (2^31) to 4,294,967,295: Advertised as 0.

 

When establishing a BGP session with the configuration shown below, FortiGate cannot advertise a Metric value of 2147483648 (2^31) or higher.
Topology: FortiGate (192.168.0.2) → Router (192.168.0.1).

 

BGP and route-map configuration in FortiGate:

 

config router bgp     config neighbor         edit "192.168.0.1"             (snip)             set route-map-out "test"         next     end end  config router route-map     edit "test"         config rule             edit 1                 set match-ip-address "prefix-list1"                 unset set-ip-prefsrc                 set set-metric <Metric value to be advertised>             next         end     next end

 

Whether the advertised MED is correctly set can be verified using:

 

get router info bgp neighbors <neighbor IP> advertised-routes
 
The following is an example of the output when this configuration is applied. 
  • When MED is configured with a value of 2147483647 or lower,
    FortiGate advertises the configured value:

 

FortiGate# get router info bgp neighbors 192.168.0.1 advertised-routes VRF 0 BGP table version is 2, local router ID is 192.168.0.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete     Network          Next Hop            Metric     LocPrf Weight RouteTag Path *>i10.10.10.0/24     192.168.0.2   2147483647    100  32768        0 i <-/-> ​

 

  • When MED is configured with a value of 2147483648 or higher,
    FortiGate does not advertise the correct Metric value and instead advertises 0:

 

FortiGate# get router info bgp neighbors 192.168.0.1 advertised-routes VRF 0 BGP table version is 2, local router ID is 192.168.0.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete     Network          Next Hop            Metric     LocPrf Weight RouteTag Path *>i10.10.10.0/24     192.168.0.2   0             100  32768        0 i <-/->​

 

Related document:

BGP multi-exit discriminator

Route maps