Community discussions

MikroTik App
 
dan64bit
just joined
Topic Author
Posts: 6
Joined: Wed Sep 26, 2018 10:31 pm

BGP route filters

Fri Sep 28, 2018 7:29 pm

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.
 
User avatar
victorsoares
Member Candidate
Member Candidate
Posts: 106
Joined: Thu Feb 15, 2018 6:29 pm
Location: Ubatuba, São Paulo - Brazil
Contact:

Re: BGP route filters

Fri Sep 28, 2018 10:11 pm

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.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: BGP route filters

Fri Sep 28, 2018 10:20 pm

However it's supposed to be +90, but it reverts back to 90 and doesn't seem to allow me to use + or -.
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.
 
dan64bit
just joined
Topic Author
Posts: 6
Joined: Wed Sep 26, 2018 10:31 pm

Re: BGP route filters

Mon Oct 01, 2018 6:43 pm

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.
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?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: BGP route filters

Mon Oct 01, 2018 8:22 pm

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.
 
dan64bit
just joined
Topic Author
Posts: 6
Joined: Wed Sep 26, 2018 10:31 pm

Re: BGP route filters

Mon Oct 01, 2018 8:49 pm

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.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: BGP route filters

Mon Oct 01, 2018 9:07 pm

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

Who is online

Users browsing this forum: Marc1963 and 25 guests