cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6310
Views
5
Helpful
12
Replies

Displaying BGP best path from neighbor

paul amaral
Level 4
Level 4

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

1 Accepted Solution

Accepted Solutions

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

View solution in original post

12 Replies 12

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

http://www.cisco.com/c/en/us/td/docs/ios/iproute_bgp/command/reference/irg_book/irg_bgp5.html#wp1156281

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

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


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

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

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

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

Hi Masoud

Agreed and no criticism intended with your suggestion at all.

Just thought it worth pointing out.

Jon

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.

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

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

paul amaral
Level 4
Level 4

i forgot to look at the routing table :(, this works well you still need to search for the next hop but it works.

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