Community discussions

MikroTik App
 
Robervaldd
newbie
Topic Author
Posts: 40
Joined: Tue Nov 15, 2016 2:11 am

how to discard all ospf routes V7.1

Mon Dec 06, 2021 10:54 pm

Does anyone have an example of a filter to discard all routes received via ospf in version 7.1?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7052
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to discard all ospf routes V7.1

Mon Dec 06, 2021 10:56 pm

You can't discard all routes. Only "external" routes can be filtered.
 
Robervaldd
newbie
Topic Author
Posts: 40
Joined: Tue Nov 15, 2016 2:11 am

Re: how to discard all ospf routes V7.1

Mon Dec 06, 2021 11:09 pm

Thanks for replying, do you have any example ospf filter for version 7.1? I tried some things here but they didn't work.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7052
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to discard all ospf routes V7.1

Mon Dec 06, 2021 11:12 pm

Be more specific what did you try to do and what didn't work.
 
Robervaldd
newbie
Topic Author
Posts: 40
Joined: Tue Nov 15, 2016 2:11 am

Re: how to discard all ospf routes V7.1

Mon Dec 06, 2021 11:21 pm

/routing ospf instance
add in-filter-chain=ospf-in name=default-v2 router-id=172.16.9.255
/routing ospf area
add instance=default-v2 name=backbone-v2
/routing ospf interface-template
add area=backbone-v2 interfaces=loopback networks=172.16.9.255/32 passive priority=1
add area=backbone-v2 interfaces=l2tp_main networks=192.168.159.1/32 type=ptp
/routing filter rule

add chain=ospf-in disabled=no rule="if (dst in 172.16.9.0/24 && dst-len==32 ) { accept } else { reject }"

[admin@Router-Escritorio] > /ip route/print where ospf=yes
Flags: D - DYNAMIC; I, A - ACTIVE; o, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DIo 0.0.0.0/0 192.168.159.1%l2tp_main 110
DIo 10.228.64.0/30 192.168.159.1%l2tp_main 110
DIo 45.132.234.0/30 192.168.159.1%l2tp_main 110
DIo 45.132.234.4/30 192.168.159.1%l2tp_main 110
DIo 45.132.234.8/30 192.168.159.1%l2tp_main 110
DIo 45.132.234.19/32 192.168.159.1%l2tp_main 110

I need to discard these routes
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7052
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to discard all ospf routes V7.1

Tue Dec 07, 2021 12:09 am

Filter is working properly here. There is no option in ROS v7 to completely discard prefix. You can only reject (exclude prefix from being elected as best route).
 
Robervaldd
newbie
Topic Author
Posts: 40
Joined: Tue Nov 15, 2016 2:11 am

Re: how to discard all ospf routes V7.1

Tue Dec 07, 2021 1:05 pm

In my scenario the filters do absolutely nothing, the routes remain exactly as they are when I enable the filter.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7052
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to discard all ospf routes V7.1

Tue Dec 07, 2021 1:17 pm

Check /routing/route print, OSPF routes should have F flag which means that those routes are filtered (rejected).

Who is online

Users browsing this forum: GoogleOther [Bot] and 6 guests