OSPFv2 Single-Area Basics

Learn how to configure a single-area OSPF backbone in RouterOS v7.

OSPFv2 Single-Area Basics

Explain It Simply

OSPF (Open Shortest Path First) is like a GPS system for your network. Every router shares its local map (link states) with everyone else. Once every router has the complete map, they independently calculate the absolute fastest route to every destination using a mathematical formula called the Dijkstra algorithm. If a road (link) closes, everyone gets an updated map and recalculates their routes instantly.

RouterOS v6 vs. v7 OSPF Configuration

If you are coming from RouterOS v6, you must understand that OSPF configuration in v7 has been completely rewritten.

  • RouterOS v6: You defined instances, added networks directly, and let the router figure out the interfaces.
  • RouterOS v7: The architecture is separated into Instances, Areas, and Templates. You no longer add networks directly to OSPF. Instead, you define interface templates that match your interfaces, assigning them to a specific area.

This new approach allows for much more granular control over interface parameters and multi-instance setups.

Configuration: Single-Area Backbone

Here is a standard configuration for a basic single-area (Backbone - Area 0) setup in RouterOS v7:

# 1. Create the OSPF instance
/routing ospf instance
add name=default-v2 version=2 router-id=10.0.0.1

# 2. Create the Backbone area associated with the instance
/routing ospf area
add instance=default-v2 name=backbone-v2 area-id=0.0.0.0

# 3. Add Interface Templates
# Match all interfaces starting with "ether" and add them to the backbone
/routing ospf interface-template
add area=backbone-v2 interfaces=ether* type=broadcast

# Add loopback interface as passive
add area=backbone-v2 interfaces=lo0 type=ptp passive
  1. Go to Routing โ†’ OSPF.
  2. Click the Instances tab. Click [+]. Name: default-v2, Version: 2, Router ID: 10.0.0.1. Click OK.
  3. Click the Areas tab. Click [+]. Name: backbone-v2, Instance: default-v2, Area ID: 0.0.0.0. Click OK.
  4. Click the Interface Templates tab. Click [+]. Area: backbone-v2, Interfaces: ether*, Type: broadcast. Click OK.
  5. Click [+] again. Area: backbone-v2, Interfaces: lo0, Type: ptp, check Passive. Click OK.

Verification & Troubleshooting

To ensure OSPF is actually working and exchanging routes:

# 1. Check OSPF Neighbors (State should be "Full")
/routing ospf neighbor print

# 2. View the Link State Database (LSA)
/routing ospf lsa print

# 3. Check the routing table for dynamic OSPF routes (Flags: D, a, o)
/ip route print where ospf