Does anyone have an example of a filter to discard all routes received via ospf in version 7.1?
You can’t discard all routes. Only “external” routes can be filtered.
Thanks for replying, do you have any example ospf filter for version 7.1? I tried some things here but they didn’t work.
Be more specific what did you try to do and what didn’t work.
/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
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).
In my scenario the filters do absolutely nothing, the routes remain exactly as they are when I enable the filter.
Check /routing/route print, OSPF routes should have F flag which means that those routes are filtered (rejected).