Skip to main content
Contributor III
June 4, 2010

Technical Tip: FortiGate BGP configuration to announce only a default static route (prefix list and route map)

  • June 4, 2010
  • 0 replies
  • 18307 views

Description

 

This article describes the available methods for advertising a default route using BGP.

 

Scope

 

FortiGate, BGP.


Solution

 

Solution 1.

This solution applies if the only static route present in the FortiGate routing table is the default route. Otherwise, it will advertise ALL static routes.
In this situation, configure BGP to redistribute all static routes without restriction  :

config router bgp
    config redistribute static
        set status enable
    end
end


Solution 2.


This solution applies when there are various static routes in the FortiGate routing table, but only the default route must be announced. In this scenario, a route-map can be used to filter out all routes (other than the default route) pulled in via static route redistribution:

 

  1. Create a prefix list to ONLY match the default route on FortiGate.

    config router prefix-list
        edit 'only_default'
            config rule
                edit 1
                    set prefix 0.0.0.0 0.0.0.0
                    unset ge
                    unset le
                next
            end
        next
    end

  2. Configure a route map linked to the prefix list:

    config router route-map
        edit "routemap1"
            config rule
                edit 1
                    set match-ip-address "only_default"
                next
            end
        next
    end

  3. Configure BGP to redistribute static routes using the route map:

    config router bgp
        config redistribute "static"
            set status enable
            set route-map "routemap1"
        end
    end

 

Once this is configured, run the command get router info bgp network to confirm that a default route is now being injected into the BGP RIB.


Solution 3.

Instead of performing static route redistribution, it is possible to announce default routes on a per-BGP neighbor basis by enabling capability-default-originate:

 

config router bgp

    config[ neighbor | neighbor-group ]

        edit <neighbor name>

            set capability-default-originate enable

end

 

Then check that a default route is being advertised to the specified peer/set of peers using the command get router info bgp neighbors <neighbor address> advertised-routes.

 

Related Articles:

Technical Tip: FortiGate BGP configuration to announce specific routes and accept only a default route (prefix list and route map)

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!