bgp-path-len BGP AS-PATH

Hello
a quick question:

I have a router that receives the FRT
I would like to limit the number of prefix to receive.
I would like to ignore all the prefix with an AS PATH higher than 2
so I can leave the rest to the default route.

I have found this post:

http://forum.mikrotik.com/t/bgp-filter-prefixes-based-on-as-path/167563/1

Someone can help me achieving this?

(the REGEXP on cisco is “[1]+_[0-9]*$” )

thank you


  1. 0-9 ↩︎

use bgp-path-len
list of all the routing filter parameters is in the manual:
https://help.mikrotik.com/docs/display/ROS/Route+Selection+and+Filters

Hello
I have seen that page, but it is set as “Only Readable Properties”

could provide me with an example?

“if (bgp-path-len in 3-50) { reject; }”
then and accept rule ?

I tried both the if… and the other method:

if (bgp-path-len < 2 ) { reject; }

but it doesnt work

I tried today again, it worked:

if (bgp-path-len > 2 ) { reject; }