Discussion:
[j-nsp] advertised route count
Richard A Steenbergen
2003-12-19 20:28:37 UTC
Permalink
Is there an easy way to obtain a count for the number of advertised routes
on a specific peer? By easy I mean, easier than show route adv bgp x.x.x.x |
count and then subtracting out the number of blank and header lines? I
don't see anything in show bgp neighbor, which is the logical place I
would assume this would be (right next to the Active prefixes and Received
prefixes counts).

Also, is there a command I just can't seem to find, or any plans to add a
command under "show route" that matches only the paths selected "best"
and/or are installed for forwarding? "show route whatever | except \*"
works if you're fine with "terse", but not for much else.
--
Richard A Steenbergen <***@e-gerbil.net> http://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)
Jared Mauch
2003-12-19 20:30:59 UTC
Permalink
Post by Richard A Steenbergen
Is there an easy way to obtain a count for the number of advertised routes
on a specific peer? By easy I mean, easier than show route adv bgp x.x.x.x |
count and then subtracting out the number of blank and header lines? I
don't see anything in show bgp neighbor, which is the logical place I
would assume this would be (right next to the Active prefixes and Received
prefixes counts).
Also, is there a command I just can't seem to find, or any plans to add a
command under "show route" that matches only the paths selected "best"
and/or are installed for forwarding? "show route whatever | except \*"
works if you're fine with "terse", but not for much else.
enterprises.2636.5.1.1.2.6.2.1

is what you want. You also want recent software such as 6.0/6.1
I seem to recall.

- jared
--
Jared Mauch | pgp key available via finger from ***@puck.nether.net
clue++; | http://puck.nether.net/~jared/ My statements are only mine.
Gary Tate
2003-12-19 21:49:51 UTC
Permalink
If you want to do it from the cli you can use:

show route advertising bgp x.x.x.x extensive | grep Pref | Count

This matches on one line of the output so you can get the number of
routes without any subtraction.

To see installed routes you should use:

run show pfe route summary


IPv4 Route Tables:
Index Routes Size(b)
-------- ---------- ----------
Default 26 1857
1 4 281

MPLS Route Tables:
Index Routes Size(b)
-------- ---------- ----------
Default 10 707

IPV6 Route Tables:
Index Routes Size(b)
-------- ---------- ----------
Default 6 473
1 3 221

If you want to see routes from a particular protocol then the used next
hop is marked with a Active and you can match on that and count.

show route advertising bgp x.x.x.x extensive | grep <Active | Count

Gary
Post by Jared Mauch
Post by Richard A Steenbergen
Is there an easy way to obtain a count for the number of advertised routes
on a specific peer? By easy I mean, easier than show route adv bgp x.x.x.x |
count and then subtracting out the number of blank and header lines? I
don't see anything in show bgp neighbor, which is the logical place I
would assume this would be (right next to the Active prefixes and Received
prefixes counts).
Also, is there a command I just can't seem to find, or any plans to add a
command under "show route" that matches only the paths selected "best"
and/or are installed for forwarding? "show route whatever | except \*"
works if you're fine with "terse", but not for much else.
enterprises.2636.5.1.1.2.6.2.1
is what you want. You also want recent software such as 6.0/6.1
I seem to recall.
- jared
--
clue++; | http://puck.nether.net/~jared/ My statements are only mine.
_______________________________________________
http://puck.nether.net/mailman/listinfo/juniper-nsp
Richard A Steenbergen
2003-12-19 22:53:02 UTC
Permalink
Post by Gary Tate
show route advertising bgp x.x.x.x extensive | grep Pref | Count
This matches on one line of the output so you can get the number of
routes without any subtraction.
That only works on iBGP sessions where you are passing a localpref. :P

But yes I see your point. A good hack for quickly trying to come to a
conclusion, but very slow and load intensive on the RE. If there were more
characters available on the screen I would suggest the count should be
part of show bgp summary... Actually, I personally find the count, which
is included on Foundry's show ip bgp sum, to be far more useful
information on a default summary output than the InPkt/OutPkt count.
Post by Gary Tate
run show pfe route summary
Index Routes Size(b)
-------- ---------- ----------
Default 26 1857
1 4 281
Index Routes Size(b)
-------- ---------- ----------
Default 10 707
Index Routes Size(b)
-------- ---------- ----------
Default 6 473
1 3 221
If you want to see routes from a particular protocol then the used next
hop is marked with a Active and you can match on that and count.
show route advertising bgp x.x.x.x extensive | grep <Active | Count
I was thinking more along the lines of a way to SEE the routes selected as
best path (or not best path for that matter). Say I wanted to see them
post local processing (not the raw data that is being sent to me), I could
do show route next-hop x.x.x.x, but I don't have any way to show the
details on the ones which either are or aren't being selected as best. I
would have to do something like "terse | except "[+\*]" | match /" to
actually get just that list, and then manually check those prefixes to see
details.

I know the keyword "best" is already taken to mean show the longest match
only, but wouldn't the show route commands really benefit from a way to
match or exclude based on the selection of best path?
--
Richard A Steenbergen <***@e-gerbil.net> http://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)
Nischal Sheth
2003-12-20 00:23:11 UTC
Permalink
Post by Richard A Steenbergen
Is there an easy way to obtain a count for the number of advertised routes
on a specific peer? By easy I mean, easier than show route adv bgp x.x.x.x |
count and then subtracting out the number of blank and header lines? I
don't see anything in show bgp neighbor, which is the logical place I
would assume this would be (right next to the Active prefixes and Received
prefixes counts).
Richard,

This has been implemented and will be available in a future release.
The output of "show bgp neighbor" will have per RIB advertised prefix
counts.

-Nischal.

Loading...