cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1796
Views
1
Helpful
2
Replies

Maximum paths in bgp

sarahr202
Level 5
Level 5

Hi everybody.

 

How is everyone doing ?

Based on my book , the best path algorithm is:

  1) weight

  2) Local-pref

  3) Locally injected routes

  4) AS path

  5)origin

  6)Med

  7) Neighbor type ( ibgp or ebgp)

  Igp metric to next hop

  9) oldest ebgp route

  10) Lowest neighbor BGP RID

  11) Lowest neighbor Ip address.

That is what my book says" If the BGP best path algorithm does not choose a best path by step 8( IGP metric to next hop)

  ,the routes which still tie for being best path will be allowed into ip routing table up to the number defined by the BGP maximum-paths router subcommand.

I created a set up where R1 will receive an bgp update about 10.0.0.0 from  its ebgp peer R2  and R3 . Both are connected to R1 via serial interface as shown below:

Here R1 is receiving update 10.0.0.0 from R2 and R3 which tie at step 8( as per above list), R1 should install both routes to 10.0.0.0 in routing table however this is not what happened.

download.png

 

No attempt was made to manipulate path attributes; all path attributes are at default. With all default path attributes and  both next hop 199.199.199.2 (R2) and 200.200.200.3 (R3) for 10.0.0.0 are located off R1 's  s0/0  and s0/1 respectively, the best path algorithm should  find the routes to prefix 10.0.0.0 at step 8 tie(  the igp metric to reach next hop).

As per my book's excerpt above, if I configure " maximum-path 2" under bgp at R1, both these routes should be allowed into routing table.  However , when I configured the above command, only one route was entered the routing table.

Below  is R1's the configuration:

R1's config:

interface Serial0/0

ip address 199.199.199.1 255.255.255.0

clock rate 2000000

interface Serial0/1

ip address 200.200.200.1 255.255.255.0

clock rate 2000000

router bgp 3

no synchronization

bgp log-neighbor-changes

neighbor 199.199.199.2 remote-as 1

neighbor 200.200.200.3 remote-as 2

maximum-paths 2

no auto-summary

R1#show ip bgp

   Network          Next Hop            Metric LocPrf Weight Path

*  10.0.0.0         199.199.199.2            0             0 1 i

*>                  200.200.200.3            0             0 2 i

R1#show ip bgp

BGP table version is 3, local router ID is 200.200.200.1

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

              r RIB-failure, S Stale

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

   Network          Next Hop            Metric LocPrf Weight Path

*  10.0.0.0         199.199.199.2            0             0 1 i

*>                  200.200.200.3            0             0 2 i

R1#show ip bgp 10.0.0.0

BGP routing table entry for 10.0.0.0/8, version 3

Paths: (2 available, best #2, table Default-IP-Routing-Table)

Multipath: eBGP

  Advertised to update-groups:

        1

  1

199.199.199.2 from 199.199.199.2 (199.199.199.2)

     Origin IGP, metric 0, localpref 100, valid, external

  2
    200.200.200.3 from 200.200.200.3 (200.200.200.3)

      Origin IGP, metric 0, localpref 100, valid, external, best

R1#show ip route

C    200.200.200.0/24 is directly connected, Serial0/1

C    199.199.199.0/24 is directly connected, Serial0/0

B    10.0.0.0/8 [20/0] via 200.200.200.3, 00:16:01

R1#

Here R1  has installed route 200.200.200.3 to reach 10.0.0.0.    In order to confirm if the routes are really tied at step 8  and R1 is using the sep 9 ( oldest ebgp route) to break the tie, i will reset R1 and R3 neighbor relationship which will cause the R1 to install 199.199.199.2 (R2) to reach 10.0.0.0 because it will be older route than via R3.

 

R1#clear ip bgp 200.200.200.3

*Mar  1 00:34:50.575: %BGP-5-ADJCHANGE: neighbor 200.200.200.3 Down User reset

*Mar  1 00:34:52.031: %BGP-5-ADJCHANGE: neighbor 200.200.200.3 Up

R1#show ip route

C    200.200.200.0/24 is directly connected, Serial0/1

C    199.199.199.0/24 is directly connected, Serial0/0

B    10.0.0.0/8 [20/0] via 199.199.199.2, 00:00:18

R1#

It proves that indeed the routes tie at step 8 because R1 uses step 9 ( oldest ebgp route) to break the tie.

============================================

The question is why  R1 is not installing both routes i.e  199.199.199.2, 200.200.200.3 to reach 10.0.0.0 because they both tie at step 8 and according to my book all routes that tie at step 8  will be allowed into the routing table provided that " maximum-path"  is configured accordingly.

 

Thanks and happy new year.

2 Accepted Solutions

Accepted Solutions

ajay chauhan
Level 7
Level 7

Whatever the results you are seeing is correct .Max path does not loadbalance if you choose two diffrent AS but it will work if you have multihome with same ISP. Try to change AS1 to AS2 or AS2 to AS1 should be same and see the results you are looking for.

Thanks

Ajay

View solution in original post

Edison Ortiz
Hall of Fame
Hall of Fame

You need to apply the hidden command on R1:

bgp bestpath as-path multipath-relax

under the router bgp process, then reset the bgp sessions.

Once restored, you will have 2 entries in the routing table and multipath entries while issuing

show ip bgp 10.0.0.0

 

View solution in original post

2 Replies 2

ajay chauhan
Level 7
Level 7

Whatever the results you are seeing is correct .Max path does not loadbalance if you choose two diffrent AS but it will work if you have multihome with same ISP. Try to change AS1 to AS2 or AS2 to AS1 should be same and see the results you are looking for.

Thanks

Ajay

Edison Ortiz
Hall of Fame
Hall of Fame

You need to apply the hidden command on R1:

bgp bestpath as-path multipath-relax

under the router bgp process, then reset the bgp sessions.

Once restored, you will have 2 entries in the routing table and multipath entries while issuing

show ip bgp 10.0.0.0

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco