11-06-2015 08:47 AM - edited 03-05-2019 02:41 AM
Hi, currently I use the following command to display the best paths from a bgp neighbor,
sh ip bgp neigh x.x.x.x routes | in >
is there a better way, i can't seem to find an actually command that will do this.
paul
Solved! Go to Solution.
11-07-2015 07:36 PM
Hello,
My answer is going to have the same result. I just wanted to mention it. The best routes are already inside the routing table. Are those all EBGP neighbors?
Show IP route BGP | (Your neighbor ip address which is the nexthop)
Masoud
11-06-2015 10:01 AM
you can select the best path from show ip bgp
Device# show ip bgp
BGP table version is 6, local router ID is 10.0.96.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter, a additional-path
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
N* 10.0.0.1 10.0.0.3 0 0 3 ?
N*> 10.0.3.5 0 0 4 ?
Nr 10.0.0.0/8 10.0.0.3 0 0 3 ?
Nr> 10.0.3.5 0 0 4 ?
Nr> 10.0.0.0/24 10.0.0.3 0 0 3 ?
V*> 10.0.2.0/24 0.0.0.0 0 32768 i
Vr> 10.0.3.0/24 10.0.3.5 0 0 4 ?
tweak bgp commands to get more specific detail
11-06-2015 10:17 AM
I know you can do that but i want to know if there is a better method than the one i have above to just list best paths for a given peer, so only best paths. I know show ip bgp neigh xxxx will give you the best path count but is there a way to just list the best paths per peer.
paul
11-07-2015 05:38 AM
Hello
sh ip bgp neighbors x.x.x.x routes
This wil show you the best and valid routes (*>) from the individual peer(s)
res
Paul
11-09-2015 11:50 AM
this will show you valid and best routes and you still need to search for best routes. the suggestion to look at the routing table and seaching for next hop seems to work better.
thanks again paul
11-09-2015 12:09 PM
Paul
Just one point on that.
Using the IP routing table will not necessarily show you all the best paths unless what you want to see are all the best paths actually in use.
A BGP best path route may well not be installed in the IP routing table due to a RIB failure because there is a route with a better AD already in there.
Just thought it worth mentioning.
Jon
11-09-2015 12:19 PM
Hello John,
Thanks for your points. I agree with you in some sense, but EBGP routes usually win over other routing protocols routes due to lower administrative distance unless ADs are manipulated or static routes are used.
Masoud
11-09-2015 12:21 PM
Hi Masoud
Agreed and no criticism intended with your suggestion at all.
Just thought it worth pointing out.
Jon
11-09-2015 12:30 PM
I appreciate your point and I get happy seeing your point. I just gave another point in response to your point. I am sure your intention was not criticism; however, I am open also to critisim.
Please countinue doing that.
11-09-2015 03:02 PM
Jon, good point. I guess the answer is to look at the BGP table and what i was origionally doing. I guess there is no easy way.
thanks, paul
11-07-2015 07:36 PM
Hello,
My answer is going to have the same result. I just wanted to mention it. The best routes are already inside the routing table. Are those all EBGP neighbors?
Show IP route BGP | (Your neighbor ip address which is the nexthop)
Masoud
11-09-2015 11:49 AM
i forgot to look at the routing table :(, this works well you still need to search for the next hop but it works.
11-09-2015 12:10 PM
Happy it worked.
1- You can also redirect the output of a command to a file. Write a command for each hop in a text file and copy and paste it. You will have a classified result in form of files.
show IP route BGP | include 172.16.1.1 | redirect tftp://x.x.x.x/172.16.1.1
show IP route BGP | include 172.16.1.2 | redirect tftp://x.x.x.x/172.16.1.2
2- Using some softwares such as NCM (network configuration manager) gives you flexibility.
Masoud
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