Remove all except one community

Marek Küthe m-k-mailling-list at mk16.de
Wed Jul 19 17:08:36 CEST 2023


Hello,

I recently discovered a new filter for myself on
https://bgpfilterguide.nlnog.net/guides/many_communities/#bird. In my
eyes it also makes sense to keep the routing table as small as
possible. But now I don't want to delete all communities, but keep a
single one. How can I implement something like that?
```
function strip_too_many_communities() {
    if ( ( bgp_community.len + bgp_ext_community.len +
bgp_large_community.len ) >= 100 ) then {
        bgp_community.empty.except((64511, *));
        bgp_ext_community.empty;
        bgp_large_community.empty;
    }
}
```

The background is that these serve in the
[dn42](https://dn42.dev/howto/Bird-communities) as information, how
good the connection to the destination is. Therefore I would like to
keep these.
Does anyone have any ideas on how to do something like this?

Greetings
Marek Küthe

-- 
Marek Küthe
m.k at mk16.de
er/ihm he/him
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20230719/7e429c5e/attachment.sig>


More information about the Bird-users mailing list