[j-nsp] Routes matching two or more communities
Harry Reynolds
harry at juniper.net
Tue May 13 15:17:38 EDT 2003
Well, for a logical or you can try this:
[edit policy-options]
lab at r3# run show route 3/8 detail
inet.0: 105888 destinations, 105889 routes (105888 active, 0
holddown, 0 hidden)
3.0.0.0/8 (1 entry, 1 announced)
*BGP Preference: 170/-101
Source: 172.16.0.14
Next hop: 172.16.0.14 via fe-0/0/2.0, selected
State: <Active Ext>
Local AS: 65412 Peer AS: 65222
Age: 5:01
Task: BGP_65222.172.16.0.14+4938
Announcement bits (3): 0-KRT 2-BGP.0.0.0.0+179
4-Resolve inet.0
AS path: 65222 10458 14203 2914 7018 80 I
Communities: 2914:420 65412:69 65412:420<<<<< route
has three comms
Localpref: 100
Router ID: 130.130.0.1
[edit policy-options]
lab at r3# run show route community "(65412:69|65412:420)"
inet.0: 105888 destinations, 105889 routes (105888 active, 0
holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
3.0.0.0/8 *[BGP/170] 00:05:11, localpref 100
AS path: 65222 10458 14203 2914 7018 80 I
> to 172.16.0.14 via fe-0/0/2.0
4.0.0.0/8 *[BGP/170] 00:05:11, localpref 100
AS path: 65222 10458 14203 2914 3356 I
> to 172.16.0.14 via fe-0/0/2.0
.
.
.
Unfortunately I know of no logical and function (&& does not work).
If you need to count routes that have both, you might try some
cascaded piping:
edit policy-options]
lab at r3# run show route detail community 65412:69 | match 65412:420 |
count
Count: 105863 lines
<< Note that I have a full BGP feed and the policy below is setting
the two comms on all routes:
[edit policy-options]
lab at r3# show policy-statement ebgp-in
term 1 {
from {
protocol bgp;
neighbor 172.16.0.14;
}
then {
community add transit;
community add test;
}
}
[edit policy-options]
lab at r3# show community transit
members 65412:420;
[edit policy-options]
lab at r3# show community test
members 65412:69;
The count pretty much matches the number of active routes:
[edit policy-options]
lab at r3# run show bgp summary
Groups: 4 Peers: 7 Down peers: 2
Table Tot Paths Act Paths Suppressed History Damp State
Pending
inet.0 105862 105861 0 0 0
0
inet6.0 1 1 0 0 0
0
Peer AS InPkt OutPkt OutQ Flaps Last
Up/Dwn State|#Active/Received/Damped...
172.16.0.14 65222 20863 59186 0 4
41:00 Establ
inet.0: 105858/105858/0
inet6.0: 1/1/0
So I think it will work for U!
HTHs.
> -----Original Message-----
> From: juniper-nsp-bounces at puck.nether.net
> [mailto:juniper-nsp-bounces at puck.nether.net]On Behalf Of
> Hazim Oumera
> Sent: Tuesday, May 13, 2003 1:26 PM
> To: juniper-nsp at puck.nether.net
> Subject: [j-nsp] Routes matching two or more communities
>
>
> Hi,
>
> I am trying to count all routes that match 2 of my
> communities. A command
> of the type: sh route community "AS:nnn AS:zzz" does not
> result in any
> routes even though I found such routes.
>
> I would appreciate any suggestions,
> Hazim
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> http://puck.nether.net/mailman/listinfo/juniper-nsp
More information about the juniper-nsp
mailing list