Community discussions

MikroTik App
 
dakobg
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Mon Nov 06, 2017 8:58 am

Routing filters fixes request

Thu Dec 16, 2021 5:13 pm

Any plans "discard" action to be implemented soon ?
Any plans "numbering order" to be fixed via winbox ?

More details in help.mikrotik.com for filtering will be nice

Look like filtering is not fully completed yet.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filters fixes request

Thu Dec 16, 2021 5:30 pm

Be more specific what examples you would like to see.

There will be no "discard", to accept only specific NLRIs you should use BGP "input.accept-*" parameters.
 
User avatar
jspool
Member
Member
Posts: 469
Joined: Sun Oct 04, 2009 4:06 am
Location: Oregon

Re: Routing filters fixes request

Thu Dec 16, 2021 5:55 pm

Is there a way to get the below filter to work on 7.1+

/routing filter
add action=accept chain=dynamic-in distance=18 prefix=0.0.0.0/0 prefix-length=0 set-distance=1 set-routing-mark=Starlink
 
dakobg
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Mon Nov 06, 2017 8:58 am

Re: Routing filters fixes request

Thu Dec 16, 2021 5:57 pm

More related when redistribute connected routes with OSPF

For example to remove (not installed in routing table / redistributed via ospf) netowrk/prefix with ospf ros6
1   chain=ospf-out prefix=10.10.0.0/16 prefix-length=0-32 invert-match=no action=discard set-bgp-prepend-path="" 

 2   chain=ospf-in prefix=10.10.0.0/16 prefix-length=0-32 invert-match=no action=discard set-bgp-prepend-path="" 
I don't have a lot of experience with filters but this work for me with ros6, is there something similar to be done in ros7 ?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filters fixes request

Thu Dec 16, 2021 6:08 pm

@jspool, there is no dynamic-in chain in ROSv7

@dakobg

something like
/routing/filter/rule/add chain=ospf-in rule="if (dst in 10.10.0.0/16 && dst-len in [0-32]) { reject}"
 
dakobg
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Mon Nov 06, 2017 8:58 am

Re: Routing filters fixes request

Thu Dec 16, 2021 6:25 pm

@jspool, there is no dynamic-in chain in ROSv7

@dakobg

something like
/routing/filter/rule/add chain=ospf-in rule="if (dst in 10.10.0.0/16 && dst-len in [0-32]) { accept}"
Ok I'm little confused .. sorry
I want the exact opposite result !

At the moment I'm using in ROS7
chain=ospf-out rule="if (dst in 10.10.0.0/16 && dst-len > 24) { reject }" 
however this still add all routes in this range in MAIN routing table as inactive / filtered
with my example for ROS6 and "action=discard" filtered routes are REMOVED from MAIN rutting table ... or NOT redistributed via OSPF (I redistribute connected routes )

I hope I was able to explain my question correctly

Regards,
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filters fixes request

Thu Dec 16, 2021 6:28 pm

Yes sorry type, it was meant to be reject.

As was mentioned previously there is no "discard". Those routes will appear in the routing table as "filtered" and by default will not be redistributed further.
 
dakobg
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Mon Nov 06, 2017 8:58 am

Re: Routing filters fixes request

Thu Dec 16, 2021 6:53 pm

Yes sorry type, it was meant to be reject.

As was mentioned previously there is no "discard". Those routes will appear in the routing table as "filtered" and by default will not be redistributed further.
Ohh ok so no way to remove them from MAIN, I have only ~40 routes in MAIN and is not a big issue, however for some users with more entries this can be somehow frustrating.
I guess this is more /ip/route print (or winbox) output only, (from visual prospective)

In winbox we have "Active is yes" which is ok

Any way thanks for the quick answer !
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Routing filters fixes request

Thu Dec 16, 2021 6:55 pm

If you have a lot of OSPF routes that you need to drop then possibly right way is to rethink your network design, but do not drop routes by filters. Possibly use multiple areas and area ranges.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Routing filters fixes request

Thu Dec 16, 2021 7:08 pm

Is there a way to get the below filter to work on 7.1+

/routing filter
add action=accept chain=dynamic-in distance=18 prefix=0.0.0.0/0 prefix-length=0 set-distance=1 set-routing-mark=Starlink
If it's used to change parameters of default route from dhcp, you can add static one (1.1.1.1 is any random address, it won't be used):
/ip route add dst-address=0.0.0.0/0 gateway=1.1.1.1 comment=dhcp1 routing-table=Starlink disabled=yes
Then set add-default-route=no for dhcp client and use lease script to update the route you added, e.g.:
:if ($bound=1) do={
  /ip route set [find where comment="dhcp1"] gateway=$"gateway-address" disabled=no
} else={
  /ip route set [find where comment="dhcp1"] disabled=yes
}
 
dakobg
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Mon Nov 06, 2017 8:58 am

Re: Routing filters fixes request

Thu Dec 16, 2021 8:31 pm

If you have a lot of OSPF routes that you need to drop then possibly right way is to rethink your network design, but do not drop routes by filters. Possibly use multiple areas and area ranges.
:D

Yep I know but sometimes redistributing connected routes between remote sites is the easy/lazy way (in small net)

Who is online

Users browsing this forum: No registered users and 60 guests