12-02-2014 12:37 PM - edited 03-05-2019 12:16 AM
I've been poking around in a few test routers trying to find where BGP states how long a route has been known from a neighbor. Based on Cisco's BGP path selection article: http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html, #10 states BGP prefers the oldest known route.
What command shows the amount of time a route has been known via BGP?
12-02-2014 01:04 PM
# show ip bgp summary will show you peer's up time
12-02-2014 01:15 PM
Yes, but a peer can stay up but still lose a route through that peer. That age isn't what I'm looking for. Thanks for your reply, though.
Anyway to see a particular route's age?
12-03-2014 12:03 AM
Hello
sh ip bgp neighbors x.x.x.x | in BGP state
sh ip route x.x.x.x | in Last
res
Paul
12-03-2014 09:18 AM
Thanks for your reply, Paul.
The first command just shows the same timer as the sh ip bgp summary timer. It's just the timer of the neighbor relationship.
The second command just displays how long the route has been in the routing table. I've tested this and found that when BGP loses a route to a network and then selects a different path that it had known about, the timer resets to 0. Even though it had known about the path for a while, it still resets to 0.
So thanks to everyone for your responses, but I'm still looking for some way to see the age of a BGP-learned route.
12-03-2014 09:35 AM
Hello
yes but the surely the only significance is the valid best route as once that best path of that route is t anymore the age of the new learned path needs to be set to zero as it a new!
12-03-2014 09:39 AM
So what if BGP has 3 routes to a certain network? One will be installed into the routing table, while 2 will not. If the route that is installed in the routing table is lost, BGP will need to choose between the other 2 routes. If all metrics are equal except time known about each route, BGP will choose based on length-of-age. I want to be able to see the age of the two routes before the original route is lost.
12-03-2014 11:01 AM
Hello
Instead of leaving bgp to select via its default path selection criteria would you want manually choose which route path should take precedence and to be entered in the routers rib through route manipulation of bgp ( Weight, Pref As-path, Med etc..)..?
res
Paul
12-03-2014 11:29 AM
That's getting sidetracked. My issue isn't path selection manipulation. I can configure BGP to choose whatever path I want it to choose.
Cisco routers choose BGP routes based on a certain set of criteria that we call attributes. I can see all of the attributes except the BGP route age as defined in the link I provided in the OP. There has to be a command that shows it and I want to know that command.
05-31-2015 05:07 AM
I don't know of command that will show you a time stamp of the oldest route in bgp. However, if you look at the possible paths under a prefix using the command show ip bgp 112.1.1.0, the router automatic orders the paths from newest to oldest. This information should help in your path selection for rule #10
09-15-2017 11:57 AM
There is no command that shows you the age of a specific path.
As other users have pointed out, there are commands that show you how long a peer has been up, but a peer can remain up while a particular path is learned / unlearned / learned from that same peer.
The reason there is no command is this information is not tracked or used in the BGP path selection process.
I know, I know... but the path selection process says BGP favors the oldest path. BUT, it doesn't work as most people think. Let me explain...
When a NEW path is learned, and the new path has all identical path atributes, the CURRENT BEST path remains as "best". The idea is the current path is likely more stable than the path which was just learned.
When a CURRENT best path is forgotten/lost, then among the REMAINING paths, the next chosen "best" path is the one from the BGP speaker with the best Router ID -- the age of the remaining paths are not considered.
The "prefer oldest path"only applies when a new path is learned, not when an best path is forgotten and the speaker is picking among remaining paths.
This is proven and illustrated in detail in the following article:
http://www.practicalnetworking.net/stand-alone/bgp-oldest-path/
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide