I’m on RouterOS 7.5. I have a VPN tunnel between locations and running OSPF over that tunnel. Something like this:
The issue I ran into (even back on ROSv6) was that the 66.2.148.252/29 route from R1 would be sent to R2, designating the 10.200.0.1 as the next hop for that route. The same would happen the other way also. Once these routes distributed, the tunnel would drop because now the R1 and R2 were not sending tunnel management traffic directly between 66.2.148.252 and 203.30.61.30, but instead between 10.200.0.1 and 10.200.0.2. This would cause the tunnel to be in a continuous cycle of going down and coming back up until OSPF redistributed the route. I solved this in ROSv6 by creating an OSPF out-filter on both routers that would not distribute the external IP’s route to the other routers.
Now in ROSv7, I’m trying to do the same thing. However, I can’t seem to get the out-filter to prevent the route to distribute. Here’s my config. I’ll readily admit that I don’t understand many of the options of OSPF in ROSv7, so there’s a good chance I’m doing something else wrong.
I think I got it figured out. There were actually two things I needed to change.
I was using the /routing ospf interface-template add …networks= attribute with the 0.0.0.0/0 network. Apparently MikroTik ignores the filter rules if the default network is being used. I switched to using the /routing ospf interface-template add …interfaces= parameter.
My routes were not being shared when using the /routing ospf interface-template add …interfaces= parameter and the following filter
Apparently filter rules default to reject unless there is an accept rule. I found that I needed to do one of two things. (1) Add an “else” path to the filter rule like this:
/ip route/print interval=1 where ospf && gateway ~ "gw1.p3"
Flags: D - DYNAMIC; A - ACTIVE; o, y - BGP-MPLS-VPN
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAo 32.185.10.0/24 172.16.16.54%wg2gw1.p3 110
DAo 172.16.17.6/32 172.16.16.54%wg2gw1.p3 110
DAo 172.20.103.0/29 172.16.16.54%wg2gw1.p3 110