cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2367
Views
0
Helpful
5
Replies

BGP best path not selecting oldest route

sarahr202
Level 5
Level 5

Hi everybody

I am kinda curious as to why R1 is not choosing the oldest route EBGP route from R3 with everything being equal up to MED ( MED is skipped as 200,200,.200.200 32 is not being announced from Same AS)

SET UP:

Above R2 and R3 are advertising 200.200.200.200/32 with MED 400 and 100 respectively to R1.

Based on the BGP best path selection process, R1 should use " age " of the route to select best path , but that is not what I observed:

R1 always select R2 ( because it has lower BGP RID) skipping the " age" of the route.  It is interesting R1 is not configured with "bgp bestpath compare-routerid" otherwise this behavior can be easily be explained.

##R1## 


R1#show running-config | section bgp
neighbor 12.12.12.2 remote-as 2
neighbor 13.13.13.3 remote-as 3
no auto-summary

##R2#
R2#show running-config | section bgp
router bgp 2
network 200.200.200.200 mask 255.255.255.255
neighbor 12.12.12.1 remote-as 1
neighbor 12.12.12.1 route-map  MEE out
no auto-summary

access-list 1 permit 200.200.200.200

route-map MEE permit 10
match ip address 1
set metric 400

##R3#
R3#show running-config | section bgp
router bgp 3
network 200.200.200.200 mask 255.255.255.255
neighbor 13.13.13.1 remote-as 1
neighbor 13.13.13.1 route-map MEE out
no auto-summary

access-list 1 permit 200.200.200.200

route-map MEE permit 10
match ip address 1
set metric 100

########################

Below we see R1 selects the path through R2 has  the best even though path through R3 is oldest:

R1#show ip bgp 200.200.200.200


BGP routing table entry for 200.200.200.200/32, version 11
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1
2
12.12.12.2 from 12.12.12.2 (200.200.200.200)
Origin IGP, metric 400, localpref 100, valid, external, best
3
13.13.13.3 from 13.13.13.3 (200.200.200.200)
Origin IGP, metric 100, localpref 100, valid, external

R1#show ip bgp

Network                            Next Hop        Metric           LocPrf    Weight Path
*> 200.200.200.200/32
                                          12.12.12.2       400                                       0 2 i
*                                         13.13.13.3       100                                       0 3 i

R1#show version
Cisco IOS Software, 3600 Software (C3660-JS-M), Version 12.4(25), RELEASE SOFTWARE (fc2)

Thanks and have a good weekend!!

1 Accepted Solution

Accepted Solutions

Hi Sarah,

I am fine.  Hope you are doing well!

Sorry about the confusion.  Referencing this link below (I know this is from a Juniper document but it should be the same as Cisco) number 9 in the list is EBGP over iBGP which does not apply to your example. Also number 10 does not apply.  So moving to number 11 says:

11-If both paths are external, prefer the currently active path to minimize route-flapping.

So, maybe this is the case in your scenario and so the router does not want to change the path to minimize route-flapping.  If this is a test environment, can you break the connection to r3 and reconnect again and see if r2 becomes active and stays active.

http://www.juniper.net/documentation/en_US/junos13.3/topics/reference/general/routing-ptotocols-address-representation.html

Thanks,

Reza

View solution in original post

5 Replies 5

Reza Sharifi
Hall of Fame
Hall of Fame

Hi Sarah,

In order for the MED attribute to be compared the neighboring AS numbers need to be the same.

Please have a look at this document with MED example deployment.

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13759-37.html

Thanks,

Reza

Hi Reza,

My long time friend how have you been?

As I noted in my post ( quoted here for easy reference , sorry for the confusion)

MED is skipped as 200,200,.200.200 32 is not being announced from Same AS)

Since next attribute to check after MED ( which is skipped here for the reason cited above), is EBGP over IBGP, EBGP is preferred over IBGP. In my example, 200.200.200.200/32 is being announced over EBGP from both peers, therefore next " BGP route age"  should have been used to break the tie.

Age of the route is the next attribute to be checked  by default unless we are using bgp bestpath compare-routerid in which case " age of the route" will be skipped and BGP router ID is used to break the tie. In my example, we are not using such command so tie should be broken at " age of the route"  but I do not see that ,rather I see R1 is using BGP ID to break the tie not age.

Thanks and have a great weekend:)

Hi Sarah,

I am fine.  Hope you are doing well!

Sorry about the confusion.  Referencing this link below (I know this is from a Juniper document but it should be the same as Cisco) number 9 in the list is EBGP over iBGP which does not apply to your example. Also number 10 does not apply.  So moving to number 11 says:

11-If both paths are external, prefer the currently active path to minimize route-flapping.

So, maybe this is the case in your scenario and so the router does not want to change the path to minimize route-flapping.  If this is a test environment, can you break the connection to r3 and reconnect again and see if r2 becomes active and stays active.

http://www.juniper.net/documentation/en_US/junos13.3/topics/reference/general/routing-ptotocols-address-representation.html

Thanks,

Reza

Hi Reza,

I tried that , but no matter how many times I reset BGP with R2, R1 will prefer path from R2 which is what puzzles me ; it appears R1 is breaking the tie on BGP router ID than age . 

Not sure if this behavior is unique to this IOS only.

Have a good weekend:)

I'm running into same issue with my lab setup. Were you able to find a solution ?

Review Cisco Networking for a $25 gift card