bgp export filters?

Ondrej Zajicek santiago at
Sat Feb 14 15:53:34 CET 2009

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 .

Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3,
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <>

More information about the Bird-users mailing list