Troubleshooting
Check the neighbor state
Start with the neighbor list on both routers:
/routing/ospf/neighbor/print
A working adjacency is in the Full state.
| What you see | Usual cause |
|---|---|
| No entry for the neighbor | Hello packets do not arrive or are dropped: firewall, area ID, Hello or Dead interval, network mask, area type or authentication differ. Read the log. |
TwoWay | Correct between two routers that are both dr-other on a broadcast or NBMA network. They exchange routes through the DR and BDR, so check that both are Full with the DR and BDR. |
Init | This router receives the neighbor's Hellos, but the neighbor does not receive this router's Hellos. Check the firewall and the link in the other direction. |
ExStart | The routers see each other, but the database exchange does not start: MTU mismatch or a duplicate Router ID. |
Full, but routes are missing | The prefix is not in OSPF (no interface template matches the interface or network), the area type filters it (stub, NSSA), an area range or routing filter suppresses it, the network type differs at the two ends of a link (for example broadcast and ptp), or the area is not attached to the backbone (it needs a virtual link). |
Read the OSPF log
OSPF writes state changes to the route,ospf,info topics and dropped packets to route,ospf,warning. The
warning names the reason, so read it first:
/log/print where topics~"ospf"
| Log message | Cause |
|---|---|
dropping Hello from <address> - hello interval mismatch | hello-interval differs. |
dropping Hello from <address> - dead interval mismatch | dead-interval differs. |
dropping Hello from <address> - network mask mismatch | The addresses on a broadcast or NBMA link have different prefix lengths. |
dropping Hello from <address> - external capability mismatch | The area types differ, for example a stub area on one router and a standard area on the other. Set the same area type on all routers of the area. |
dropping DD from <address> - mtu size too large | The interface MTU differs. The neighbor stays in ExStart. |
authentication failed from <address> message has no authentication | Authentication is configured on one router only. |
authentication failed from <address> wrong SA ID | auth-id differs. |
An area ID mismatch produces no warning. The neighbor disappears from the list, and the log shows only that
the neighbor timed out. Compare the
area-id on both routers.
Allow OSPF in the firewall
OSPF uses IP protocol 89. Hello packets go to the multicast address 224.0.0.5, which never matches a
connection-state=established rule. A router with the default configuration drops everything on
interfaces outside the LAN interface list, so OSPF on a WAN port or another non-LAN interface gets no
neighbor. Accept OSPF on the OSPF interface, here ether2, before the drop rule:
/ip/firewall/filter
add chain=input protocol=ospf in-interface=ether2 action=accept \
comment="accept OSPF" \
place-before=[find comment="defconf: drop all not coming from LAN"]
For OSPFv3, add the same rule to the IPv6 firewall:
/ipv6/firewall/filter
add chain=input protocol=ospf in-interface=ether2 action=accept \
comment="accept OSPF" \
place-before=[find comment="defconf: drop everything else not coming from LAN"]
For BFD and the other routing protocols, see Allow routing protocols.
Use a unique Router ID
Every router in the OSPF domain needs its own Router ID. Two neighbors with the same Router ID stay in
ExStart. Set router-id explicitly, for
example to a loopback address, instead of relying on the address RouterOS picks.
Links that lose multicast
OSPF finds neighbors with multicast Hellos on broadcast and point-to-point networks. A Layer 2 device that
blocks or changes multicast, or a wireless link that does not deliver multicast reliably, makes
neighbors flap or never appear. On such links, use the nbma network type with static neighbors at both
ends, so that OSPF sends only unicast packets:
/routing/ospf/interface-template
set [find interfaces=ether4 and area=area1] type=nbma
/routing/ospf/static-neighbor
add area=area1 address=10.0.12.2%ether4
Both routers need the nbma type and a static neighbor that points to the other router. See
Discovery on NBMA subnets.