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.
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'
Using the command 'get router info routing-table bgp' only one default route is shown on the routing table.
Observing the BGP configuration, the command 'set ebgp-multipath enable' is already part of it.
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.
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.
Note: The command 'get router info bgp network 0.0.0.0' will keep the word best for one of the routes. |