Community discussions

MikroTik App
 
HamRadio
just joined
Topic Author
Posts: 19
Joined: Wed Feb 15, 2017 5:33 pm

Router OSv7 BGP Route Filters

Mon Feb 19, 2024 11:57 pm

Hi All...

I'm sure I'm just dense, which is the reason I need to ask. I'm trying to configure some route filters for BGP, specifically the output chain. I got a BGP session up between my two routers, and they are advertising routes between the two of them. I want to put some filters in place that make sure only the routes I want are advertised on the output... However, once I select my output filter, my second router no longer sees the routes from the first router. What am I doing wrong?

I've tried a couple different things, and they both have the same results:
/routing filter rule
add chain=bgp-out comment="Management Network" disabled=no rule="if ( dst==172.16.0.0/22) { accept }"
However, once I select this filter under BGP Connection, I select under "Output Filter" my "bgp-out" the routes are no longer advertised. What am I doing wrong? Thanks!
 
Railander
Frequent Visitor
Frequent Visitor
Posts: 85
Joined: Thu Jun 16, 2016 11:30 pm

Re: Router OSv7 BGP Route Filters

Tue Feb 20, 2024 3:29 am

maybe unintuitive.

for BGP the default is to accept all routes, but for filters the default is to reject all routes.
when you did not set a filter yet for the BGP connection, it will by default receive and send everything, but as soon as you set a filter it will by default reject everything.
if you want to accept all even with a filter set, create that filter with rule="accept"
 
User avatar
baragoon
Member
Member
Posts: 310
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

Re: Router OSv7 BGP Route Filters

Tue Feb 20, 2024 7:39 am

Did you select output-network in the BGP connection?
 
HamRadio
just joined
Topic Author
Posts: 19
Joined: Wed Feb 15, 2017 5:33 pm

Re: Router OSv7 BGP Route Filters

Tue Feb 20, 2024 5:58 pm

maybe unintuitive.

for BGP the default is to accept all routes, but for filters the default is to reject all routes.
when you did not set a filter yet for the BGP connection, it will by default receive and send everything, but as soon as you set a filter it will by default reject everything.
if you want to accept all even with a filter set, create that filter with rule="accept"
Doesn't this rule say to accept?
add chain=bgp-out comment="Management Network" disabled=no rule="if ( dst==172.16.0.0/22) { accept }"
 
HamRadio
just joined
Topic Author
Posts: 19
Joined: Wed Feb 15, 2017 5:33 pm

Re: Router OSv7 BGP Route Filters

Tue Feb 20, 2024 6:00 pm

Did you select output-network in the BGP connection?
I tried that and it didn't seem to make a difference...
 
pe1chl
Forum Guru
Forum Guru
Posts: 10248
Joined: Mon Jun 08, 2015 12:09 pm

Re: Router OSv7 BGP Route Filters

Tue Feb 20, 2024 6:04 pm

What you have there would only accept one specific route: to the network 172.16.0.0/22
Any routes for subnets of that network would not be accepted, and due to the fact that the default is reject, will not pass through.

Probably you meant something like: if (dst in 172.16.0.0/22)

Who is online

Users browsing this forum: No registered users and 2 guests