Community discussions

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

BGP route filtering

Mon Oct 15, 2018 8:50 pm

We are switching to Microtik for our BGP router and we are currently using OpenBGPD. Mostly things are pretty straight forward when switching over but there are some differences I can't seem to wrap my head around. For example, we have the following route filters on OpenBGPD:

match from group "group1" source-as AS 1234 set {localpref +150}
match from group "group1" transit-as AS 1234 set {localpref +50}

source-as being the rightmost AS number and transit-as being all but the rightmost AS number.

Is there any way to do this on RouterOS? I know you can do multiple rules per chain, but I can't seem to figure out how this could be done.
 
bbs2web
Member Candidate
Member Candidate
Posts: 232
Joined: Sun Apr 22, 2012 6:25 pm
Location: Johannesburg, South Africa
Contact:

Re: BGP route filtering

Thu Oct 25, 2018 9:57 pm

There unfortunately isn't a + or - operator, so you need to set local preference explicitly.

/router filter add bgp-as-path="^(111_)+(222_)+$" set-bgp-local-pref=150
as111 is transit and as222 origin

"_222$"
Originated by as222

"_111_"
Transits as111
 
bbs2web
Member Candidate
Member Candidate
Posts: 232
Joined: Sun Apr 22, 2012 6:25 pm
Location: Johannesburg, South Africa
Contact:

Re: BGP route filtering

Thu Oct 25, 2018 9:59 pm

You need to escape out $ via cli, eg:
bgp-as-path="^(111_)+(222_)+\$"

Who is online

Users browsing this forum: No registered users and 53 guests