ospf distribut list

i cut some not usefull routes from incoming and outgoing redistribute like this on my cisco router
i leave only needed routes in this example

router ospf 999
router-id X.X.X.X
log-adjacency-changes
network X.X.X.X 0.0.0.7 area 0
distribute-list 30 out
distribute-list 30 in

access-list 30 permit Y.Y.Y.0 0.0.0.63
access-list 30 permit Z.Z.Z.0 0.0.0.127
access-list 30 permit A.A.A.128 0.0.0.127
access-list 30 permit S.S.S.0 0.0.0.255

how can i make this on mikrotik?

Routing - Filters?

could you give me more concrete example?

To filter ospf routes use ospf-in and ospf-out chains.
Example drop all incoming routes except default route:

/routing filter
add chain=ospf-in prefix=0.0.0.0/0 invert-match=yes action=discard

Routing filter manual:
http://www.mikrotik.com/testdocs/ros/2.9/routing/filter.php

hm… why ‘invert-match=yes’?

and how i can to accept two or three net?

/routing filter
add chain=ospf-in prefix=A.A.A.A/24 invert-match=yes action=discard
add chain=ospf-in prefix=B.B.B.B/24 invert-match=yes action=discard

in this case net A.A.A.A/24 accepted but B.B.B.B/24 not :frowning:

/routing filter
add chain=ospf-in prefix=A.A.A.A/24 invert-match=no action=accept
add chain=ospf-in prefix=B.B.B.B/24 invert-match=no action=accept
add chain=ospf-in action=drop

why is there another filtering in RIP? what is difference?

I have one question regarding this.

Is there a way of blocking large segment of distributed routes instead of filthering exact small segments? For example, I have /30 networks that are distributed and are part of /24 segment, and when I try to use more globar rule it does nothing. I have to have exact rule for every distributed network in route list, no matter the size?

use ‘prefix length’, set it to ‘24-32’, for example

Thank you. :slight_smile: