BGP route filters

We are moving from an OpenBSD-based router to a Microtik router and I am trying to figure out the route filters on Microtik.

We have a route filter on OpenBSD, for example:

match from 1.1.1.1 AS 1234 set { localpref +90 }

So I created a new route filter with the prefix 1.1.1.1, put the BGP AS path as 25512 and set BGP local pref as +90.

However it’s supposed to be +90, but it reverts back to 90 and doesn’t seem to allow me to use + or -.

I’m not able to test if this works, but I just wanted to see if that is on the right track or if I am going about this the wrong way.

Thanks.

Nevermind the BGP AS Patch field, you will set this on your BGP Peers, as for the local pref, Mikrotik works only with positive numbers, it does not understand negatives or positives. You might want to go with something like 100 for your main ISP and 10 to your secondary, if there is any. If there is only one ISP you can leave this field empty and mk will sort the rest for you.

In RouterOS it is not possible to add to or subtract from the localpref in a route filter.
You will have to use absolute values (that replace the localpref for that route).
The default of course is 100 so in this case you would enter 190.

Okay so maybe I am missing on where this goes. So if I create a route filter setting the localpref to 190, I would set this to the outgoing filter of the 1.1.1.1 peer, but I don’t see where I would apply the rule to AS 1234. You say it would be set on my BGP peer but I don’t see where this would go?

That advice was not really correct. Of course you can match on the BGP as path to apply certain filter rules to one AS.
When you have more than one peer and you really want to weigh the usage of the peers, you can also create separate filters for each peer and assign them as incoming filters for each peer. And then you can just set the localpref without matching.

So essentially to create that rule all I need to do is create a route filter with the localpref set to 190 and the BGP AS path set to the remote AS I want to apply that rule to and then set it to outgoing filter on the peer?

Basically I just want to set the localpref to 190 for 1.1.1.1 going to AS 1234.

I think you would usually set a localpref on an incoming filter. This attribute is not sent to external peers, only internal (iBGP).