BGP Multipath Scenario
BGP unlike other protocols doesn’t do load balance by default and installs a single best route in the routing table by default. Even in the BGP table you see a single best route.
But like other protocols in BGP we can use the ‘multipath’ command to install more than one route for a prefix in the routing table.
In this post we will use the topology diagram below and understand the configuration of BGP multipath.
In the above post we have customer running AS 100 and a service provider running on AS 200. R1 is the CE router which is dual homed with two PE routers of the service provider and running EBGP with them. Keeping everything on the default if we want to reach 18.104.22.168 address from R1 we will have only a single best path installed on the routing table.
Outputs as below from R1:
In the BGP table we see we are getting the route for R4 from both R2 and R3 but route from R3 is considered as the best under routing table due to BGP path selection criteria.
R1#sh ip bgp | b 22.214.171.124
R1#sh ip route | b 126.96.36.199
In the above configuration only single link from R1 > R3 will be used to reach 188.8.131.52 address.
Now let us suppose we want to use both paths R1>R2 and R1>R3 to reach 184.108.40.206, so we will make use of BGP multipath option to keep both the parallel paths in the routing table. In order for both the parallel paths to be installed in the BGP routing table we will need to make sure the following BGP attributes are kept same on both paths.
- Local Preference
- AS Path (both AS number and AS path length)
- Origin code
- IGP metric
Multipath can be configured for three options:
- iBGP Multipath: If two parallel paths exist in Ibgp.
- eBGP Multipath: If two parallel paths exist in EBGP
- eiBGP Multipath: If two parallel paths exist with a combination of EBGP and IBGP.
In our scenario we are getting two parallel paths from EBGP, hence we can use EBGP multipath in our configuration on R1 as below:
Now if we check we will be getting both the routes installed in the routing table of R1.
R1#sh ip bgp
R1#sh ip route
Hence we see route for 220.127.116.11 on R1 is installed in the routing table from both R2 and R3.
Related- BGP disable-connected-check