Community discussions

MikroTik App
 
theradioguy
just joined
Topic Author
Posts: 13
Joined: Wed Dec 22, 2021 4:59 am

Routing filter to discard routes

Wed Dec 29, 2021 6:29 pm

Hoping someone can help me out here.

I have a CCR1009 which is taking a full BGP feed from my upstream, unfortunately the number of routes in the table makes the router unstable and querying the routing table is slow. My solution in routerOS 6 was to create a filter to only accept the routes I am interested in, this worked extreamly well and the router was rock solid.

In ROS 7 it seems the "reject" action in the filter leaves the routes in memory (but with an "invalid" flag) which again causes the router to be slow and unstable. I am unable to find a statement to completely discard routes on a BGP session, am I missing something?
 
vitaleg
just joined
Posts: 2
Joined: Sun Jan 09, 2022 1:35 pm

Re: Routing filter to discard routes

Sun Jan 09, 2022 1:38 pm

The same problem.
Please explain why "discard" is not available in routeros 7? And how to discard unnecessary routes.
 
User avatar
netzwerghh
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Sun Aug 07, 2011 4:23 pm
Location: Hamburg, DE
Contact:

Re: Routing filter to discard routes

Tue Jan 11, 2022 11:09 am

I would like to vote this up. There should be at least two possibilities to discard/reject learned routes. One could install the routes with status filtered/inactive and the other on should completely ignore the route.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filter to discard routes

Tue Jan 11, 2022 1:45 pm

you can drop NLRIs before filters, check input.accept-* parameters:
https://help.mikrotik.com/docs/pages/vi ... p/template
 
User avatar
netzwerghh
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Sun Aug 07, 2011 4:23 pm
Location: Hamburg, DE
Contact:

Re: Routing filter to discard routes

Tue Jan 11, 2022 1:50 pm

you can drop NLRIs before filters, check input.accept-* parameters:
https://help.mikrotik.com/docs/pages/vi ... p/template
Thank you mrz, that is great to know. Could you add a hint to this alternative option and behaviour under https://help.mikrotik.com/docs/pages/vi ... r-Commands in the documentation? That would be great!
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filter to discard routes

Tue Jan 11, 2022 1:53 pm

You can find this already in the documentation:
https://help.mikrotik.com/docs/display/ ... figuration
 
User avatar
netzwerghh
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Sun Aug 07, 2011 4:23 pm
Location: Hamburg, DE
Contact:

Re: Routing filter to discard routes

Tue Jan 11, 2022 2:30 pm

Okay, seems I overread that part.
 
theradioguy
just joined
Topic Author
Posts: 13
Joined: Wed Dec 22, 2021 4:59 am

Re: Routing filter to discard routes

Tue Jan 18, 2022 5:51 am

Thanks for the replies guys, I can confirm that passing a prefix list to ' Accept Input NLRI' has the desired effect of removing the unwanted prefixes from memory.
 
DarkNate
Forum Veteran
Forum Veteran
Posts: 997
Joined: Fri Jun 26, 2020 4:37 pm

Re: Routing filter to discard routes

Sun Nov 13, 2022 1:53 pm

But how do we "discard" based AS-PATH instead of prefix list?
 
O1DMBFan
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Fri Dec 05, 2008 11:08 pm

Re: Routing filter to discard routes

Thu Dec 15, 2022 12:14 am

I'm looking to drop these "rejected" routes from memory/routing table; however I'm unable to figure out how to do so. We're only running OSPF, not BGP. Could anyone provide a brief example of how to prevent these rejected routes from showing up in our routing table at all, regardless of it's "invalid" flag.

IE: if (dst in X.X.X.X/YY) {reject} else {accept}

Thanks!
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: Routing filter to discard routes

Thu Dec 15, 2022 9:32 am

I'm looking to drop these "rejected" routes from memory/routing table; however I'm unable to figure out how to do so. We're only running OSPF, not BGP. Could anyone provide a brief example of how to prevent these rejected routes from showing up in our routing table at all, regardless of it's "invalid" flag.
Hi,

You have to use input.accept-nlri for the BGP connection or template (or other input.accept-* options if they work better for your use case). You can't prevent them from showing up in the routing table using filters.
 
User avatar
loloski
Member Candidate
Member Candidate
Posts: 277
Joined: Mon Mar 15, 2021 9:10 pm

Re: Routing filter to discard routes

Sat Dec 30, 2023 1:25 pm

sorry for beating the dead horse, can someone shed some light on why discard is no longer available in ros v7?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10183
Joined: Mon Jun 08, 2015 12:09 pm

Re: Routing filter to discard routes

Sat Dec 30, 2023 1:32 pm

It is a result of the rewrite of the routing protocol engines, where the filtering now has been moved into another process.
This was done to allow the use of more than one core of the CPU. In the v6 days the complaint was that even when you had a 72-core beast of a router, all BGP processing still was done on a single core.
The new routing engine fixes that, because it has options to have each peer connection handled by a different core, and some of the routing tasks done by yet another core.
But apparently (at least in the design they use) that means that filter processing can no longer be done while receiving the routes. All received routes are stored in a table, and then another process marks them as accepted/filtered, and of course yet another process decides which one is active and used for routing.

The "accept NLRI" feature is a bit lacking, because an address list only has entries for (sub)nets, not for prefix length.
A common case would be "I only want to accept the 0.0.0.0/0 route and the routes to these subnets", but once you put 0.0.0.0/0 in the NLRI accept list it accepts EVERYTHING, because all networks match 0.0.0.0/0.
That is something they should fix, e.g. by adding an option "Input accept default route" that you could check when using "Input accept NLRI". Or maybe by having a "not" ("!") option which would not accept but rather would drop anything in the address list.
 
User avatar
loloski
Member Candidate
Member Candidate
Posts: 277
Joined: Mon Mar 15, 2021 9:10 pm

Re: Routing filter to discard routes

Sat Dec 30, 2023 2:13 pm

I hope this functionality can be restored in OSPF at least, this is what set apart from MT to other big brand where dynamic routing protocols is rock solid, another grief is when you have millions of routing entries in routing tables winbox start to crawl well that's for another day totally unrelated here.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10183
Joined: Mon Jun 08, 2015 12:09 pm

Re: Routing filter to discard routes

Sat Dec 30, 2023 3:06 pm

Yes it would be great when "filter" in winbox would be processed on the router instead of in winbox.exe itself! Also for other lists.
 
Nareke734
just joined
Posts: 1
Joined: Tue Jan 30, 2024 7:51 am

Route filter reject

Tue Jan 30, 2024 7:57 am

IN BGP ROUTE FILTERS I AM ADDING THE REJECT FROM DST IP BUT IN ROUTE LIST IT STILL AVAILABLE HOW CAN I SOLVE IT?[flash=][/flash]

Who is online

Users browsing this forum: No registered users and 25 guests