[c-nsp] show ip bgp community (not X) ?

Peter Rathlev peter at rathlev.dk
Mon Mar 17 06:45:04 EDT 2008


Hi Mike,

On Sun, 2008-03-16 at 19:35 -0700, Michael Smith wrote:
> I realize you're asking a bigger question but, in answer to your one  
> above, you can do a "sho ip bgp community | exclude <whatever you want  
> to exclude>".

Hmm... When I do a "show ip bgp community" it only shows routes with
communities, not what communities each have. And routes with no
communities never show up.

>    One thing I noticed is that the pattern matching  
> appears to look for everything after the ":" in the new-format.  So,  
> we match all incoming routes from TWTC with 11274:4323.  When I try to  
> match 11274:4323 I get nothing.  When I match 4323 I get everything  
> *but* 11274:4323.

I'm not sure I follow. Using 7200/12.4, 6500/SXF and 7600/SRB I can't
seem to just get a list of what communities each route has (in one line
so I can filter). That would of course solve the problem.

Here's a setup where I have one router (R1) tag all it's own routes with
communities 100 and 101 when sending to it's peer group neighbors. Seen
from R2, an immediate neighbor, I have:

R2#sh ip bgp           
BGP table version is 88, local router ID is 10.252.255.2
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
*> 0.0.0.0          0.0.0.0                  0         32768 ?
* i                 10.253.99.1              0    100      0 i
*>i10.0.1.0/24      10.252.255.7             0    100      0 ?
* i10.250.0.0/30    10.252.255.1             0    100      0 ?
*>                  0.0.0.0                  0         32768 ?
* i10.250.0.4/30    10.252.255.3             0    100      0 ?
*>                  0.0.0.0                  0         32768 ?
* i10.250.0.8/30    10.252.255.4             0    100      0 ?
*>i                 10.252.255.3             0    100      0 ?
* i10.250.0.12/30   10.252.255.5             0    100      0 ?
*>i                 10.252.255.4             0    100      0 ?
* i10.250.0.16/30   10.252.255.5             0    100      0 ?
*>i                 10.252.255.6             0    100      0 ?
*>i10.250.0.20/30   10.252.255.1             0    100      0 ?
* i                 10.252.255.6             0    100      0 ?
* i10.250.0.24/30   10.252.255.7             0    100      0 ?
*>                  0.0.0.0                  0         32768 ?
   Network          Next Hop            Metric LocPrf Weight Path
* i10.250.0.28/30   10.252.255.7             0    100      0 ?
*>i                 10.252.255.6             0    100      0 ?
*>i10.251.0.0/24    10.252.255.5             0    100      0 ?
*>i10.251.2.0/24    10.252.255.4             0    100      0 i
*>i10.251.3.0/24    10.252.255.4             0    100      0 i
*>i10.251.4.0/24    10.252.255.3             0    100      0 ?
*> 10.251.5.0/24    0.0.0.0                  0         32768 i
*> 10.251.6.0/24    0.0.0.0                  0         32768 i
*> 10.251.7.0/24    0.0.0.0                  0         32768 i
*> 10.251.8.0/24    0.0.0.0                  0         32768 i
*> 10.251.9.0/24    0.0.0.0                  0         32768 i
*> 10.251.10.0/24   0.0.0.0                  0         32768 i
*>i10.251.11.0/24   10.252.255.1             0    100      0 i
*>i10.251.12.0/24   10.252.255.1             0    100      0 i
*>i10.251.13.0/24   10.252.255.1             0    100      0 i
*>i10.251.14.0/24   10.252.255.6             0    100      0 ?
*>i10.251.15.0/24   10.252.255.5             0    100      0 ?
*>i10.251.16.0/24   10.252.255.5             0    100      0 ?
*>i10.251.19.0/24   10.252.255.6             0    100      0 ?
*>i10.251.21.0/24   10.252.255.6             0    100      0 ?
*>i10.251.22.0/24   10.252.255.7             0    100      0 ?
*>i10.251.23.0/24   10.252.255.7             0    100      0 ?
   Network          Next Hop            Metric LocPrf Weight Path
*>i10.251.24.0/24   10.252.255.3             0    100      0 ?
*> 10.251.25.0/24   0.0.0.0                  0         32768 i
*> 10.251.26.0/24   0.0.0.0                  0         32768 i
*>i10.251.27.0/24   10.252.255.5             0    100      0 ?
*>i10.251.28.0/24   10.252.255.5             0    100      0 ?
*>i10.251.29.0/24   10.252.255.6             0    100      0 ?
*>i10.251.35.0/24   10.252.255.7             0    100      0 ?
*>i10.251.98.0/24   10.252.255.1             0    100      0 i
*>i10.251.99.0/24   10.252.255.1             0    100      0 i
*>i10.252.255.1/32  10.252.255.1             0    100      0 i
*> 10.252.255.2/32  0.0.0.0                  0         32768 i
*>i10.252.255.3/32  10.252.255.3             0    100      0 ?
*>i10.252.255.4/32  10.252.255.4             0    100      0 ?
*>i10.252.255.5/32  10.252.255.5             0    100      0 ?
*>i10.252.255.6/32  10.252.255.6             0    100      0 ?
*>i10.252.255.7/32  10.252.255.7             0    100      0 ?
* i10.253.58.0/24   10.252.255.7             0    100      0 ?
*>i                 10.252.255.1             0    100      0 ?
*>i10.253.99.0/24   10.252.255.1             0    100      0 i
R2#

Looking at a specific prefix from R1 I can see the communities:

R2#sh ip bgp 10.251.11.0
BGP routing table entry for 10.251.11.0/24, version 22
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  Local
    10.252.255.1 (metric 10) from 10.252.255.1 (10.252.255.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Community: 100 101
R2#

Just running "show ip bgp community" gives me a list of routes with a
community, but not what each community is:

R2#sh ip bgp comm      
BGP table version is 88, local router ID is 10.252.255.2
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
* i0.0.0.0          10.253.99.1              0    100      0 i
* i10.250.0.0/30    10.252.255.1             0    100      0 ?
*>i10.250.0.20/30   10.252.255.1             0    100      0 ?
*>i10.251.11.0/24   10.252.255.1             0    100      0 i
*>i10.251.12.0/24   10.252.255.1             0    100      0 i
*>i10.251.13.0/24   10.252.255.1             0    100      0 i
*>i10.251.98.0/24   10.252.255.1             0    100      0 i
*>i10.251.99.0/24   10.252.255.1             0    100      0 i
*>i10.252.255.1/32  10.252.255.1             0    100      0 i
*>i10.253.58.0/24   10.252.255.1             0    100      0 ?
*>i10.253.99.0/24   10.252.255.1             0    100      0 i
R2#

They're both 6500/SXF if that matters. I get the same results from a
7200 w/ 12.4 IP IPSEC 3DES in production.

Am I using the wrong commands or what? :-)

Thank you,
Peter




More information about the cisco-nsp mailing list