Skip to main content
DPadula
Staff & Editor
Staff & Editor
June 21, 2024

Technical Tip: Adding second default route with BGP using 'set bestpath-as-path-ignore enable'

  • June 21, 2024
  • 0 replies
  • 3096 views
Description This article describes how to avoid the best AS-PATH criteria while selecting the best route for the default route in the BGP routing protocol allowing us to have two default routes learned via BGP on the routing table
Scope FortiGate.
Solution

Different from other routing protocols, BGP can only add one route to a destination on the routing table by default, to add more than one route, enable the multipath (ibgp-multipath and/or ebgp-multipath). Sometime enabling multipath will be enough to add routes to the same destination via different neighbours but in some cases we also need to enable bestpath-as-path-ignore.

 

Diagram.PNG

 

On the network diagram above, both routers have a default route to the Internet. This can be seen on HQ-FW01 FortiGate using the command 'get router info bgp neighbors <neighbour_ip_address> received routes'

 

both default routes.png

 

Using the command 'get router info routing-table bgp' only one default route is shown on the routing table.

 

routing table.PNG

 

Observing the BGP configuration, the command 'set ebgp-multipath enable' is already part of it.

 

bgp configuration.png

 

One default route is showing on the routing table. The reason is the AS-PATH advertised by IPS1 and ISP2 routers.

ISP1 router has advertised 0.0.0.0/0 with two AS-PATH (AS 62000 appears twice). That is why FortiGate has added to 0.0.0.0/0 via ISP2 and marked it as best.

 

bgp network 0000.png

 

Adding the command 'set bestpath-as-path-ignore enable' and restarting the BGP peer connection with the command 'execute router clear bgp all' allows BGP to ignore the AS-PATH attribute and add both default routes to the routing table.

 

double 0000.png

 

Note:

The command 'get router info bgp network 0.0.0.0' will keep the word best for one of the routes.

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT