RadiusNest › Guides

MikroTik OSPF setup for a small ISP network

Last updated: 11 October 2026

When your network grows past two or three routers (a main site, a few towers, a backup link), keeping static routes on every router gets error-prone. OSPF lets the routers tell each other which networks they have and finds a new path when a link fails.

Before you change a live router: take a backup (how) and turn on Safe Mode in Winbox, so a mistake that locks you out is undone by itself.

Plan first

  • Every router gets a router ID, written like an address. Use a /32 loopback address per router, such as 10.255.255.1, .2, .3.
  • Links between routers get small networks, such as 10.0.12.0/30 between router 1 and router 2.
  • For a small network, put everything in the backbone area (0.0.0.0).

1. A loopback address on each router

/interface bridge add name=loopback
/ip address add address=10.255.255.1/32 interface=loopback

An empty bridge stays up when cables are unplugged, so the address and router ID stay stable.

2. RouterOS v7

/routing ospf instance add name=default-v2 version=2 router-id=10.255.255.1 redistribute=connected
/routing ospf area add name=backbone-v2 area-id=0.0.0.0 instance=default-v2
/routing ospf interface-template add area=backbone-v2 networks=10.0.12.0/30 type=ptp
/routing ospf interface-template add area=backbone-v2 networks=10.255.255.1/32 passive

On the router that has the internet line, also share the default route:

/routing ospf instance set default-v2 originate-default=always

2. RouterOS v6

/routing ospf instance set [find default=yes] router-id=10.255.255.1 redistribute-connected=as-type-1
/routing ospf network add network=10.0.12.0/30 area=backbone
/routing ospf network add network=10.255.255.1/32 area=backbone

On the internet router: /routing ospf instance set [find default=yes] distribute-default=always-as-type-1.

Repeat on every router with its own router ID and link networks. Customer networks reach the others through redistribute (v7) or redistribute-connected (v6), so you do not list each of them.

3. Check

/routing ospf neighbor print
/ip route print where ospf

A healthy neighbour reaches the state Full. Routes learned from OSPF show with the flag o in the route list.

When neighbours do not come up

  • No neighbour at all: the link network is not in an interface template (v7) or network (v6), the firewall drops OSPF (IP protocol 89), or the two ends are in different areas.
  • Stuck in ExStart or Exchange: the MTU differs at the two ends of the link. Make it equal.
  • Two routers with the same router ID: routes come and go. Every ID must be unique.

PPPoE and hotspot customers

A PPPoE server creates one interface per customer. Do not run OSPF on those; let the customer addresses reach OSPF through redistribute, ideally as a few address pools rather than hundreds of single addresses.

When not to bother

Two routers and one link: a static route is simpler. OSPF pays off from three routers, or as soon as there are two paths between sites.

Questions and answers

Do I need OSPF for a small ISP?

Not with one or two routers. From three routers, or when there are backup paths between sites, OSPF saves work and fails over by itself.

Why is my MikroTik OSPF neighbour stuck in ExStart?

Usually the two ends of the link have different MTU values. Make them the same.

Did OSPF change between RouterOS v6 and v7?

Yes, the commands changed: v7 uses instances, areas and interface templates; v6 uses instance settings and networks.

Related guides

Start the free trial See pricing