[c-nsp] can I use | pipe line such as "| inc xxx" and regexp such as "regexp ^$" both , when I execute "show bgp "

Per Carlson pelle at hemmop.com
Thu Sep 23 13:07:18 EDT 2010


> As far as I can tell from the docs[0] the "show bgp regexp" seems to
> accept quotes. Can you verify that by any chance?

It's in the man page as well:

--8<--

RP/0/7/CPU0:mormor#man command show bgp regexp

Note If the regular expression contains spaces, it must be specified and
surrounded by quotation marks.

EXAMPLES

  The following is sample output from the show bgp regexp command:

RP/0/RP0/CPU0:router# show bgp regexp "^3 "
BGP router identifier 10.0.0.5, local AS number 1
BGP main routing table version 64
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid,> best
i - internal, S stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i172.20.17.121 10.0.101.2 100 0 3 2000 3000 i
*>i10.0.0.0 10.0.101.2 100 0 3 100 1000 i
*>i172.5.23.0/24 10.0.101.2 100 0 3 4 60 4378 i

--8<--

But in practice, it doesn't work:

RP/0/7/CPU0:mormor#show bgp regexp "^$"
RP/0/7/CPU0:mormor#


Trying to match a AS doesn't work either:

RP/0/7/CPU0:mormor#show bgp regexp ^32
   Network            Next Hop            Metric LocPrf Weight Path
*>i10.100.0.0/16      10.100.10.133            0    100      0 32 i
*>i10.100.10.4/30     10.100.10.133                 100      0 32 ?
*>i10.100.10.128/30   10.100.10.133                 100      0 32 ?
*>i172.16.3.15/32     10.100.10.133                 100      0 32 15 i
*>i172.16.3.32/32     10.100.10.133            0    100      0 32 i
*>i192.168.15.0/24    10.100.10.133                 100      0 32 15 i
RP/0/7/CPU0:mormor#

RP/0/7/CPU0:mormor#show bgp regexp "^32"
RP/0/7/CPU0:mormor#

RP/0/7/CPU0:mormor#show bgp regexp "^32 "
RP/0/7/CPU0:mormor#


-- 
Pelle

RFC1925, truth 11:
 Every old idea will be proposed again with a different name and
 a different presentation, regardless of whether it works.



More information about the cisco-nsp mailing list