BGP Community output filter

Hi all,
I have a problem using bgp community in the output filters.
My request is to filter in output all the networks not tagged as: 1234:1

This are the filter lines:

add action=accept bgp-communities=1234:1 chain=output-1234
add action=reject chain=output-1234 prefix=0.0.0.0 prefix-length=0-32

The first line of this filter seem to be match all the networks, if I remove it, then all the networks will be filtered from the second line.

The filter list is applied as out-filter to a bgp peer.

Rev 6.24

Thanks for your help
Loris

This should do what you want..


add chain=output-1234 action=accept invert-match=yes bgp-communities=1234:1
add chain=output-1234 action=discard invert-match=no

Faisal

Thanks Faisal, I have tried your proposa, but I have the same problem, this filter send the full table and not only the route tagged with the community 1234:1. The output communities filter seem to be not working fine.

L.

Post your config, you may have a typo some where.
You can always troubleshoot by playing with the filters..

I think your discard prefix is deceptive.

In every other Mikrotik context I have experience with, an IP address in a field with no mask means /32 mask.
So if that’s also true for prefix filters, 0.0.0.0 with no mask → 0.0.0.0/32 which only matches exactly 0.0.0.0

It should probably be prefix=0.0.0.0/0

Try that.