cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2093
Views
80
Helpful
16
Replies

BGP -Best path selection

Cisconew
Level 1
Level 1
Hi all,
I have configured BGP on R1,R2 & R3.

R1 & R2 : IBGP : (ASN: 65100)

R3 - ASN: 64519

R3 received 192.169.1.0/24 prefix from R1 & R2. 

R3 chosen route from R2 as best path.
Based on which attribute R3 selected the best Path? 

 

Can someone explain, why ?

Network Topology:

2022-02-25 (2).png

Show bgp commands for reference:

2022-03-03 (4).png

 

2022-03-03 (5).png

 

16 Replies 16

balaji.bandi
Hall of Fame
Hall of Fame

BGP path selection go with attributes - as per the output, i believe because of the MED

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Why metric is not shown for R1?

What metric should we consider if it is not given?

can I see the show ip route for R3?

why metric not appear??
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/112965-bgpmed-attr-00.html

 

please find link above, and remember the MED not cross the AS, i.e. the metric from R2 toward R1 then R1 will remove it because it pass AS boundary.

Hello

Edited - All things equal I would say lowest router id is the tie breaker.
sh ip bgp x.x.x.x bestpath


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

2022-03-03 (6).png

How do i find it has selected oldest ebgp path?

Hello

Apologies bestpath-compare i meant to state , however this would be limited to the IOS you are using, could try it in anycase.

show bgp ipv4 unicast x.x.x. bestpath-compare


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

I do small Lab and Set the MED =0 in R1 to route update to R3 and then 
R3 select the best path through the R1 not R2 so this indication to
before MED=0 in R1 the R3 select the bath toward R2 because of MED have value "even if it 0" and toward R1 there is no value.

for missing value please try this command
bgp best path med missing-as-worst

Hello

@MHM Cisco World  if both rtrs in as 6500 advertise the same prefix towards as 64519 and all things being equal i would say it goes down the last bgp selection criteria's which would be router ids, not med


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello

Update
FYI - just quickly formed a basic lab test best on the OP, and indeed all things equal the lower rid won the selection.

 -
IOS-XRv-R1#sh bgp ipv4 unicast 100.100.100.100/32 bestpath-compare
Fri Mar 4 12:33:14.520 UTC
BGP routing table entry for 100.100.100.100/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 10 10
Last Modified: Mar 4 12:05:42.071 for 00:27:33
Paths: (2 available, best #1)
Advertised IPv4 Unicast paths to update-groups (with more than one peer):
0.2
Path #1: Received by speaker 0
Advertised IPv4 Unicast paths to update-groups (with more than one peer):
0.2

 

23
10.1.12.2 from 10.1.12.2 (2.2.2.2)
Origin IGP, localpref 100, valid, external, best, group-best
Received Path ID 0, Local Path ID 1, version 10
Origin-AS validity: (disabled)
best of AS 23, Overall best
Path #2: Received by speaker 0
Not advertised to any peer

 

23
10.1.13.3 from 10.1.13.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external
Received Path ID 0, Local Path ID 0, version 0
Origin-AS validity: (disabled)
Higher router ID than best path (path #1)


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Friend 
1-the router-ID compare 1.1.1.1 and 2.2.2.2 not 2.2.2.2 and 3.3.3.3
2- the lower router-ID 2.2.2.2 have MED=0 which as I mention before is prefer than the MED unvalued.
3-try do same lab but same router-id and check result.

In this case, if MED is equal, it will choose the best path based on below order.

  • Prefer the lowest multi-exit discriminator (MED)
  • Prefer an external path over an internal path
  • Prefer the path through the closest IGP neighbor
  • Prefer the oldest route for eBGP paths
  • Prefer the path with the lowest neighbor BGP RID
  • Prefer the path with the lowest neighbor IP address

Yes

1- med is equal 

2-both are ebgp

3-both direct connect so igp is equal 

4-oldest if you do clear ip bgp, this make r3 know from both router approximately same time.

5-router id here

R2 have router id 2 2.2.2 

R1 have router id 1.1.1.1

So R1 will win have lowest.

Review Cisco Networking for a $25 gift card