BGP Filter Problem - Workaround

I wanted to relay an issue and workaround that we have noticed regarding routing filters not being applied in at least BGP in RouterOS v5.6

For example, when adding a routing filter via the winbox gui to drop inbound routes based on BGP prefix length; you would on “Matchers” tab name your chain, on the “BGP” tab, in an example enter “2-32” on the BGP AS Path Length field, and “Actions” tab Action = “discard”.

This creates a rule with the additional ‘prefix=0.0.0.0’ which will never match.

[mpulk@ ] /routing filter> pr
Flags: X - disabled
0 chain=in-short-only prefix=0.0.0.0 prefix-length=0-32 invert-match=no action=discard

workaround - use the command line to add the filter, example:

add action=discard bgp-as-path-length=2-32 chain=in-short-only disabled=no invert-match=no protocol=bgp

gives a rule that will work -

[mpulk@ ] /routing filter> pr

0 chain=in-short-only protocol=bgp bgp-as-path-length=2-32 invert-match=no action=discard

Appears to be an issue with the GUI adding that matcher..

This problem will be fixed in next ROS version.

WOW , because this i had discarded 2 RB1200 ( don’t run ROS 4.x ) and change it by OLD RB1000 :stuck_out_tongue:

BR