Filter ext_community?

Ondrej Zajicek santiago at crfreenet.org
Fri Sep 13 00:09:28 CEST 2019


On Thu, Sep 12, 2019 at 03:43:07PM -0500, Chris Herdt wrote:
> I have a number of routes that include non-standard bgp_ext_community
> entries, for example unknown 0x10b (VRF Route Import).
> 
> Is there a way to filter bgp_ext_community for only route targets?
> 
> I tried the following, but the ec datatype expects integers, not wildcards:
> 
> show route filter { if (rt, *, *) ~ bgp_ext_community then accept; reject;


Do you want to reject routes containing non-rt ext communities,
or just to remove non-rt ext communities from routes?

The second could be done simply by:

bgp_ext_community.filter( [ (rt, *, *) ] );

You can match against ext-comm sets (which support wildcards) using this:

if bgp_ext_community ~ [ (rt, *, *) ] then ...

But that will accept any route that has any rt ext community, regardless
of whether they have non-rt community.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at 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."


More information about the Bird-users mailing list