Filter route by type?

did someone know whether it’s possible to filter by route type?

I would like to add the non routeable networks (like RFC 1918, RFC6598, etc) as unreachable routes at my network edges. But such routes also get announced via ospf. i like to filter them on ospf-in. But how? Has someone an idea how to filter them?

How about a filter ?


e.g.
/routing filter
add action=accept chain=junk disabled=no invert-match=no prefix=0.0.0.0/0 prefix-length=0 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=127.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=172.16.0.0/12 prefix-length=12-32 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=192.168.0.0/16 prefix-length=16-32 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=223.255.255.0/24 prefix-length=24-32 set-bgp-prepend-path=“”
add action=accept chain=junk disabled=no invert-match=no prefix=224.0.0.0/11 prefix-length=11-32 set-bgp-prepend-path=“”

Ok that’s not what i’m looking for as i have some RFC 1918 routes i use inside the network. But i think i got an idea: filtering 10.0.0.0/8 but only if it’s a /8. That should filter the discard routes from being distributed over OSFP while still distributing the more specific actual routes.

yep, you can also mix and match to create / customize the filter, by allowing specific route/prefix before deny…