BGP Multipath Scenario

Rashmi Bhardwaj | Blog,Config & Troubleshoot,Routing & Switching
Advertisements

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.

BGP Multipath: Scenario Example

In this post we will use the topology diagram below and understand the configuration of BGP multipath.

Advertisements

BGP Multipath Scenario

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 4.4.4.4 address from R1 we will have only a single best path installed on the routing table.

Outputs as below from R1:

R1#sh ip bgp summary

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 2, main routing table version 2

1 network entries using 144 bytes of memory

2 path entries using 160 bytes of memory

1/1 BGP path/bestpath attribute entries using 136 bytes of memory

1 BGP AS-PATH entries using 24 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 464 total bytes of memory

BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor     V          AS       MsgRcvd     MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

9.9.12.2        4          200      25                 24               2             0        0      00:19:10        1

9.9.13.3        4          200      23                 22               2             0        0       00:17:07        1

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 4.4.4.4

*   4.4.4.4/32       9.9.12.2                               0 200 i

*>                         9.9.13.3                               0 200 I   #####Best Route######

R1#sh ip route | b 4.4.4.4

B        4.4.4.4 [20/0] via 9.9.13.3, 00:14:16

In the above configuration only single link from R1 > R3 will be used to reach 4.4.4.4 address.

Now let us suppose we want to use both paths R1>R2 and R1>R3 to reach 4.4.4.4, 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.

  • Weight
  • Local Preference
  • AS Path (both AS number and AS path length)
  • Origin code
  • MED
  • 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:

R1(config)#router bgp 100

R1(config-router)#maximum-paths 2

Now if we check we will be getting both the routes installed in the routing table of R1.

R1#sh ip bgp

BGP table version is 3, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

Network                Next Hop   Metric   LocPrf   Weight   Path

*m  4.4.4.4/32     9.9.12.2          0                                         200 I ##‘m’ means multipath enabled #

*>                           9.9.13.3         0                                         200 i

R1#sh ip route

1.0.0.0/32 is subnetted, 1 subnets

C        1.1.1.1 is directly connected, Loopback0

4.0.0.0/32 is subnetted, 1 subnets

B        4.4.4.4 [20/0] via 9.9.13.3, 00:01:36

                        [20/0] via 9.9.12.2, 00:01:36

9.0.0.0/8 is variably subnetted, 4 subnets, 2 masks

C        9.9.12.0/24 is directly connected, FastEthernet0/0

L        9.9.12.1/32 is directly connected, FastEthernet0/0

C        9.9.13.0/24 is directly connected, FastEthernet1/0

L        9.9.13.1/32 is directly connected, FastEthernet1/0

Hence we see route for 4.4.4.4 on R1 is installed in the routing table from both R2 and R3.

Continue Reading:

BGP disable-connected-check

Understanding BGP Community Attributes

ABOUT THE AUTHOR


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart