Community discussions

MikroTik App
 
Balu75
just joined
Topic Author
Posts: 6
Joined: Mon Aug 27, 2012 3:26 pm

Problem with understanding ospf-out filter

Thu Dec 05, 2013 4:53 pm

Hello All !

I need some help with understanding filtering rules in ospf-out chain.
For example, I have OSPF enabled board, with many /32 and /30 connected and static routes, that are in the same prefix, for example in 192.168.0.0/16, and some routes in other prefixes. I want to redistribute only those prefixes that are in prefix 192.168.0.0/16, so I build ospf-out filter:
0 chain=ospf-out prefix=192.168.0.0/16 prefix-length=16 invert-match=no
action=accept set-bgp-prepend-path=""

Nothing happens, board redistributes all connected/static routes in all prefixes.
Ok, I slightly change it, trying to deny everything else except of 0 rule:
0 chain=ospf-out prefix=192.168.0.0/16 prefix-length=16 invert-match=no
action=accept set-bgp-prepend-path=""

1 chain=ospf-out invert-match=no action=reject set-bgp-prepend-path=""

And now board totally stops to redistribute all external prefixes.
I tried to change first rule making prefix= without masklen, or with empty prefix-length=, but nothing happens, when I insert 1 rule with rejecting everything else I totally lost redistributing of external prefixes.
Reading WiKi about Routing filters doesn't help, I'm stuck.
Please give me a glue, how can I match all more specific routes within the same subnet, and deny everything else in ospf-out filter ?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Problem with understanding ospf-out filter

Thu Dec 05, 2013 5:11 pm

You need to specify correct prefix length or range of prefix lengths

prefix=192.168.0.0/16 prefix-length=16 means that you will match only 192.168.0.0/16


To match prefixes inside this /16 use

prefix=192.168.0.0/16 prefix-length=17-32
 
Balu75
just joined
Topic Author
Posts: 6
Joined: Mon Aug 27, 2012 3:26 pm

Re: Problem with understanding ospf-out filter

Thu Dec 05, 2013 5:22 pm

Yes, this prefix-length range helps ! Big thanks to you, mrz!
I think that WiKi must be extended with example like this.
 
lucim100
just joined
Posts: 8
Joined: Wed May 14, 2014 2:02 pm

Re: Problem with understanding ospf-out filter

Wed Mar 25, 2020 4:34 pm

You need to specify correct prefix length or range of prefix lengths

prefix=192.168.0.0/16 prefix-length=16 means that you will match only 192.168.0.0/16


To match prefixes inside this /16 use

prefix=192.168.0.0/16 prefix-length=17-32

Thank you , this solved my issue filtering out PPTP /32 ips over OSPF

Who is online

Users browsing this forum: No registered users and 11 guests