Hi! I'm trying to get a grip on BIRD, and I'm slowly getting there. One thing that puzzles me, though, is how to catch a BGP route entry that has no community list at all. What is the appropriate syntax? I'm runnig out of character combinations to try ... ;-) Non-realistic, but short, example: Accept only routes with empty community. protocol pipe foo { table tbl1; peer table tbl2; mode transparent; import filter { if bgp_community = [] then # <-- WHAT TO WRITE HERE?! accept; reject; }; export all; } I'm looking for something along the lines of a boolean method bgp_community.isEmpty or a way to simulate that. I suppose one could also turn it all around and try to say: if bgp_community ~ [(*,*)] then reject; accept; doesn't work either. You can't say set A is member of set B. I understand that. Cheers, /Lars-Johan Liman #---------------------------------------------------------------------- # Lars-Johan Liman, M.Sc. ! E-mail: liman@netnod.se # Senior Systems Specialist ! Tel: +46 8 - 562 860 12 # Netnod Internet Exchange, Stockholm ! http://www.netnod.se/ #----------------------------------------------------------------------
On Tue, Dec 21, 2010 at 12:15:45PM +0100, Lars-Johan Liman wrote:
Hi!
I'm trying to get a grip on BIRD, and I'm slowly getting there.
One thing that puzzles me, though, is how to catch a BGP route entry that has no community list at all. What is the appropriate syntax? I'm runnig out of character combinations to try ... ;-)
There is probably no natural way to do this. Community lists currently support just variants of membership testing. But your last idea should work:
I suppose one could also turn it all around and try to say:
if bgp_community ~ [(*,*)] then reject; accept;
doesn't work either. You can't say set A is member of set B. I understand that.
Expression clist ~ pair_set should work like 'exists C from clist such that C ~ pair_set'. In your example the problem is that we currently support '*' in pair_set only in the second part of the pair, like (123,*), but you can write something like [(0,0)..(65535,65535)]. Therefore expression bgp_community ~ [(0,0)..(65535,65535)] should do what you want (if you have version 1.2.5, there is a bug in older ones in pair sets). -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
santiago@crfreenet.org:
There is probably no natural way to do this. Community lists currently support just variants of membership testing.
OK.
But your last idea should work: ... Expression clist ~ pair_set should work like 'exists C from clist such that C ~ pair_set'. In your example the problem is that we currently support '*' in pair_set only in the second part of the pair, like (123,*),
Ah! Got it! Thanks!
but you can write something like [(0,0)..(65535,65535)].
Therefore expression bgp_community ~ [(0,0)..(65535,65535)] should do what you want (if you have version 1.2.5, there is a bug in older ones in pair sets).
Yup, seems to work. (I have 1.2.5.) Many thanks! Cheers, /Liman
participants (2)
-
Lars-Johan Liman -
Ondrej Zajicek