Community discussions

MikroTik App
 
User avatar
gmsmstr
Trainer
Trainer
Topic Author
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 3:41 pm

I want to load a BGP peer that is sending me full + default.. I need anything that has its AS ONLY, no transit, to come in but everything else to be discarded. Normally I would create a filter that would accept where AS-PATH=AS# then discard the rest, but in v7 can’t discard the rest? the NLRI don't help... Thoughts?

What is the correct method of doing this….
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 3:58 pm

On RouterOS 7, if you use filters, what is not accepted is implicity discarded.
 
User avatar
gmsmstr
Trainer
Trainer
Topic Author
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 4:09 pm

If you don't specify anything ,it still loads it, it is just filtered :( I want those prefixes to be discarded and not loaded into memory at all... not a option in v7?
Last edited by gmsmstr on Thu Mar 16, 2023 4:14 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 4:11 pm

I'm not one expert on BGP, but why you can not create filters???
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 4:11 pm

I believe he means "discard from memory". It is not possible, input-nlri and others are used to discard fast, regexps are not fast so are not available as a method to discard bgp update messages directly.
You can only reject with filters.
 
User avatar
gmsmstr
Trainer
Trainer
Topic Author
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 4:18 pm

We could do that in v6 :(
 
User avatar
gmsmstr
Trainer
Trainer
Topic Author
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 5:29 pm

Maybe we need a soft-reconfigure option, i.e. if its turned on as normal, it would function like it does. If we turn it off. A reject will remove it from memory.. ? Would be a simple method of doing it.
 
User avatar
gmsmstr
Trainer
Trainer
Topic Author
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Thu Mar 16, 2023 10:39 pm

What about if in HW.. If I load 2000 routes, the rest are filtered, does 2000 routes get added to HW only?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How in v7? Selectivity accept prefixes, not load the rest?

Fri Mar 17, 2023 9:31 am

HW candidate routes can be only active routes and with the HW flag set.
Filtered routes will never be active.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: How in v7? Selectivity accept prefixes, not load the rest?

Fri Mar 17, 2023 11:52 am

I believe he means "discard from memory". It is not possible, input-nlri and others are used to discard fast, regexps are not fast so are not available as a method to discard bgp update messages directly.
You can only reject with filters.
At least in v6 you had the option to discard with filters (instead of only reject).
The accept-nlri is much more limited because it accepts using an address list, and address lists do not have prefix-length.
For this case you would want to accept 0.0.0.0/0 with prefix length 0, but as an address list 0.0.0.0/0 simply accepts everything.
It would be better when accept-nlri would use some dedicated mechanism that is more like the v6 filtering where you can specify a list of items to be accepted or discarded. That would not need to have slow functions like regexp, just a simple list of prefixes with prefix length range. This case could then be written as:
action=accept prefix=0.0.0.0/0 prefix-len=0-0
action=discard
 
User avatar
Splash
Member Candidate
Member Candidate
Posts: 206
Joined: Fri Oct 16, 2015 10:09 am
Location: Johannesburg, South Africa

Re: How in v7? Selectivity accept prefixes, not load the rest?

Fri Nov 17, 2023 7:57 pm

V7 cannot really cope without a discard rule...especially when using peering route servers on non ARM64 based routers.....
Its crazy that I have 1m (Many RS servers from difference exchanges) routes in my router that the filters have to pass through each time there is a change, when they could be filtered once and discarded.
 
thesysadmin
just joined
Posts: 8
Joined: Tue Oct 10, 2023 4:30 pm

Re: How in v7? Selectivity accept prefixes, not load the rest?

Sat Nov 18, 2023 3:49 am

You should be able to accept any routes with an AS Path containing only your provider's AS.
/routing/filter/rule
add chain=myChain rule="if (bgp-as-path 1234) {accept}"
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: How in v7? Selectivity accept prefixes, not load the rest?

Sat Nov 18, 2023 11:22 am

What he (and others above) is worried about is that such a filter rule only prevents the route to become active. It is still put in the table but as "filtered". That takes up resources.
In v6 such filters would discard the route before it is being stored somewhere.

Who is online

Users browsing this forum: No registered users and 19 guests