Hi! I've two questions regarding filtering of bgp announcements. One simple and one more complicated :-) The simple one: I do not want to announce prefixes that have the community 0:64003 attached, but all other prefixes. What I did is: export filter { if (0,64003) ~ bgp_community then { reject; } accept; }; The peer receives no prefixes at all. Any hints? The other question is more interesting/complicated. Is it possible to include some kind of macros in outbound filters? What I would like would be: export macro XYZ { if (0,<remote-as>) ~ bgp_community then { reject; } accept; }; and in the per bgp peering section I'd only write: export filter XYZ; Does that feature exist? If not, would somebody else need something? regards, Harald -- Harald Michl <harald.michl@univie.ac.at> Vienna University - ACOnet www.ACO.net - VIX www.VIX.at Universitaetsstrasse 7, A-1010 Vienna, Austria, Europe Tel: +43 1 4277 - 14078 (Fax: - 9140) HM3550-RIPE
On Fri, Feb 13, 2009 at 08:55:01PM +0100, Harald Michl wrote:
Hi!
I've two questions regarding filtering of bgp announcements. One simple and one more complicated :-)
The simple one:
I do not want to announce prefixes that have the community 0:64003 attached, but all other prefixes. What I did is:
export filter { if (0,64003) ~ bgp_community then { reject; } accept; };
The peer receives no prefixes at all. Any hints?
This seems to be correct, so perhaps there is a bug in Bird. You can add some print statements and examine log wheter bgp_community contains what you expect it should contain.
The other question is more interesting/complicated. Is it possible to include some kind of macros in outbound filters? What I would like would be: ... Does that feature exist? If not, would somebody else need something?
You can have named filters (but without parameters) See test_filter in doc/bird.conf.example . You can also define functions and use them in filters. See also http://bird.network.cz/?get_doc&f=bird-5.html . -- 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."
participants (2)
-
Harald Michl -
Ondrej Zajicek