Mikrotik RoS v7.1 OSPF – problem with


Actually, one of the scenarios with OSPF is the distribution of routing information from one branch to another, and there were no problems in 6. I set up a zone, included a range there, issued by any PtP server, and client addresses flew to all branches. Yes, it is very inconvenient when there are many such routes, they can usually be aggregated and there is no problem. But in 7, the problem is different, either because of a bug, or I am doing something wrong, but the routes for PtP clients are not distributed.


The solution itself is pretty simple.

You just need to declare a static blackhole route to the subnet of these clients with a large metric and assign static routes to propagate in OSPF. There is almost everything here, you also need to filter the routes so that only the necessary ones are distributed, then there will be a code:

/ip route
add blackhole disabled=no distance=255 dst-address= gateway="" pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=255 dst-address= gateway= pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10

/routing ospf instance
add name=ospf-instance-1 out-filter-chain=ospf-out redistribute=static,ospf router-id=

/routing ospf area
add instance=ospf-instance-1 name=ospf-area-1
add area-id= instance=ospf-instance-1 name=local type=stub

/routing filter rule
add chain=ospf-out disabled=no rule="if ( protocol static ){r
    n if( dst== && dst-len==24 ) { accept }r
    n} else {r
    n rejectr

/routing ospf area range
add area=local disabled=yes prefix=

/routing ospf interface-template
add area=ospf-area-1 dead-interval=4s hello-interval=1s networks= type=ptp
add area=local networks= passive
add area=local networks= passive prefix-list= type=ptp
add area=local networks= passive prefix-list= type=ptp

For the example above, the network is dedicated for L2TP clients, is a “trial” network to test the filter’s work and should not be propagated.

The filter logic is as follows: if the route is static, then check it for compliance with the criterion, if not, then discard it.

Let’s look at the routes on a neighboring router:

Flags: D - DYNAMIC; A - ACTIVE; c, o, d, y - COPY
    DST-ADDRESS       GATEWAY                 DISTANCE
DAd                200
DAc       bridge-ISP                     0
D o       110
DAc     gre-tunnel1                    0
DAo       110
DAo       110
DAo       110
DAc     <l2tp-ppp1>                    0
DAc       ether3                         0
DAc  ether4                         0

As you can see from the listing above, there are only announced routes and route / 32 to the router itself.

Similar Posts

Leave a Reply