OSPF in a single area
OSPF builds a complete topological map by exchanging Link State Advertisements. This chapter walks through neighbour formation, the router ID, the DR/BDR election on multi-access segments, and a complete single-area configuration.
What you'll learn
- Configure OSPFv2 in a single area with the network and router-id commands.
- Explain Hello/Dead timers and the conditions for adjacency.
- Identify when DR/BDR is elected and when it is bypassed.
How OSPF builds adjacencies
OSPF routers exchange Hello packets every 10 seconds (every 30 on non-broadcast media). Two routers become neighbours after exchanging Hellos with matching area, hello/dead timers, authentication, subnet and stub-area flag. The MTU is not in the Hello: it is compared later, in the Database Description packets, so an MTU mismatch lets the neighbour appear and then stalls it in EXSTART or EXCHANGE. Once full, they share complete LSDBs and run Dijkstra to compute the best path to every prefix.
Router ID — the OSPF identity
Each router has a 32-bit Router ID, written as a dotted-decimal IP. Selection priority: explicit 'router-id', then the highest IP on an up/up loopback, then the highest IP on any other up/up interface. Only an up loopback counts — a loopback that is shut down is skipped entirely, however high its address, and the next candidate wins. The process never runs with 0.0.0.0: with no usable address it simply cannot pick an ID.
The Router ID is chosen when the OSPF process starts, and then it is sticky. Adding a higher loopback later, or typing a new 'router-id', changes nothing until the process restarts ('clear ip ospf process' or a reload). Always set Router ID explicitly with 'router-id' so renumbering interfaces does not change router identity.
15 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time
Build it step by step
- Two routers that learn the networkJoin two sites over a WAN link, then let OSPF fill in the routing tables that you would otherwise type by hand. · 7 steps · ~20 min · 5 devices
- A backup link that waits its turnRun two sites over a fast primary link, park a floating static route on a slow standby line, then pull the primary and watch the backup carry the traffic. · 8 steps · ~20 min · 4 devices
- Steer OSPF with link costGive OSPF two paths between two sites, watch it choose the cheaper one over the shorter one, then re-rate a link and watch the route move. · 7 steps · ~25 min · 5 devices
- Share one default route with OSPFGive the edge router a default route to the provider, then let OSPF hand it to the rest of the campus instead of typing it on every router. · 7 steps · ~22 min · 5 devices
- OSPF across two areasSplit an OSPF network into a backbone and a branch area, and make one router the border between them. · 7 steps · ~28 min · 7 devices
- Fix it: Fix the OSPF adjacenciesThree routers run OSPF and nothing converges. Find the area mismatch and the network statement that matches nothing. · 6 steps · ~20 min · 5 devices
- Redundant campusDouble every link and box between a desk and HQ — bundled, spanning-tree protected, VRRP gateways, twin OSPF circuits — then break two of them and keep working. · 10 steps · ~50 min · 8 devices