Static routes break the moment a link goes down and nobody updates the config. OSPF fixes this by letting routers automatically learn the network topology, share that information with each other, and recalculate the best path whenever something changes. It is the most widely deployed interior routing protocol in enterprise networks, and it appears on virtually every CCNA exam. What you need to understand is how OSPF routers form neighbors, what information they share, how they choose paths, and why a broken neighbor adjacency is the first thing to check when routes are missing.
Practice this topic
OSPF routers discover each other by sending Hello packets to the multicast address 224.0.0.5. Before two routers will exchange routing information, they have to form a neighbor relationship. This requires matching Hello and Dead intervals, the same Area ID, the same subnet, compatible authentication settings, and matching MTU on some platforms. If any of these do not match, OSPF stays stuck at Init or Two-Way and never progresses to Full.
Once neighbors are fully adjacent, they flood Link State Advertisements (LSAs) across the area. Each LSA describes a piece of the topology: which networks a router is connected to, what the cost is, and who the neighbors are. Every router collects all the LSAs and builds an identical Link State Database (LSDB). From that database, each router runs the Dijkstra shortest path first (SPF) algorithm to calculate the lowest-cost path to every destination.
Cost is the metric OSPF uses to choose paths. By default, Cisco calculates cost as 10^8 (100,000,000) divided by the interface bandwidth in bits per second. A 100 Mbps link has a cost of 1. A 10 Mbps link has a cost of 10. This default breaks on links faster than 100 Mbps because they all get cost 1. Fix this by setting the reference bandwidth to match your fastest link: auto-cost reference-bandwidth 1000 for a 1 Gbps network.
OSPF organizes routers into areas to limit the scope of LSA flooding. All OSPF networks must include Area 0, the backbone area. Other areas connect to Area 0 through Area Border Routers (ABRs). This hierarchy keeps the LSDB small and SPF calculations fast in large networks.
On broadcast networks like Ethernet, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) to reduce the volume of LSA traffic. Instead of every router forming a full adjacency with every other router, all routers form adjacencies only with the DR and BDR. The DR and BDR communicate with non-designated routers at 224.0.0.6. Election: highest OSPF priority wins (default 1, range 0-255, priority 0 means never a DR). Tie goes to highest Router ID.
Route types in OSPF output: O is an intra-area route (same area). O IA is an inter-area route (learned through an ABR from another area). O E1 or O E2 are external routes redistributed into OSPF. On the CCNA, knowing O versus O IA is usually enough.
OSPF neighbor not forming: check Hello/Dead interval match, same area, same subnet, no authentication mismatch, matching MTU.
Route not appearing: verify OSPF is active on the correct interface (check passive-interface settings), check area configuration, confirm neighbor adjacency is Full.
Path selection: OSPF chooses the path with the lowest cumulative cost. If a faster path exists but OSPF ignores it, check that reference-bandwidth is consistent across all routers.
DR election: highest priority wins. Priority 0 means the router will never be DR or BDR. Ties go to highest Router ID (often the highest loopback IP).
O in routing table = intra-area OSPF. O IA = inter-area. O E2 = external, cost does not accumulate. O E1 = external, cost accumulates.
| State | Meaning |
|---|---|
| Down | No Hellos received yet |
| Init | Hello received but router's own ID not in the Hello |
| Two-Way | Bidirectional communication established; DR/BDR election happens here |
| ExStart | Establishing master/slave and initial sequence number |
| Exchange | Sharing Database Description (DBD) packets |
| Loading | Requesting missing LSAs with LSR packets |
| Full | LSDB synchronized; adjacency complete |
OSPF uses hop count as its metric.
OSPF uses cost, which is based on bandwidth. Lower bandwidth links have higher cost. Hop count is the metric used by RIP, not OSPF.
Two-Way state means the OSPF adjacency is complete.
Two-Way means bidirectional communication is established and DR/BDR election can occur. Full adjacency, where LSDBs are synchronized, is required before routing information is actually exchanged.
OSPF requires every router to have the same LSDB as every other router globally.
OSPF LSDBs are scoped to areas. Routers in the same area share the same LSDB. Routers in different areas have different LSDBs and learn about other areas through summary LSAs from ABRs.
These questions are representative of what you will see on CCNA exams. The correct answer and explanation are shown immediately below each question.
Two OSPF routers are directly connected but their neighbor relationship is stuck in the EXSTART state. What is the most likely cause?
Explanation: ExStart is where OSPF negotiates the master/slave relationship and initial DBD sequence numbers. An MTU mismatch causes DBD packets to be dropped, stalling the process at ExStart/Exchange. Mismatched Hello/Dead intervals prevent reaching Two-Way. Area ID mismatch prevents reaching Init/Two-Way. Priority affects DR election, not neighbor state progression.
An OSPF router shows route O IA 10.2.0.0/24 in its routing table. What does this indicate?
Explanation: O IA means OSPF Inter-Area — the route was learned from a different OSPF area via an Area Border Router. O (without IA) indicates intra-area routes. O E1 or O E2 indicate external routes redistributed into OSPF. O*E2 indicates an external default route.
All routers in an OSPF network have the default reference bandwidth. A Gigabit Ethernet interface and a 100 Mbps interface both appear in the SPF calculation. What is the OSPF cost of the GigE interface?
Explanation: The default OSPF cost formula is 10^8 / bandwidth in bps. For a 1 Gbps interface: 100,000,000 / 1,000,000,000 = 0.1, which rounds to 1. For 100 Mbps: 100,000,000 / 100,000,000 = 1. Both get cost 1 by default, which is why the reference bandwidth must be raised on networks with interfaces faster than 100 Mbps.
On an Ethernet segment with five OSPF routers, which routers form Full adjacencies with each other?
Explanation: On multi-access networks like Ethernet, OSPF elects a DR and BDR. All DROther routers form Full adjacency with the DR and BDR only. DROther routers see each other in Two-Way state but never reach Full adjacency with each other. This reduces the number of adjacencies from n(n-1)/2 to 2(n-2) + 1.
A network engineer configures 'ip ospf priority 0' on a router's Ethernet interface. What is the effect?
Explanation: OSPF priority 0 means the router explicitly removes itself from DR/BDR election. It will never become a DR or BDR on that segment. This is useful for routers that lack the resources to handle DR responsibilities, such as low-end access routers.
OSPF neighbor formation requires: matching Hello and Dead intervals, the same Area ID on the connecting interface, the same subnet, compatible authentication settings, and (on some platforms) matching MTU. If routers are stuck in Down or Init state, check these parameters with 'show ip ospf interface' and 'debug ip ospf adj'.
The Designated Router (DR) is elected on multi-access networks (like Ethernet) to reduce OSPF flooding overhead. Instead of every router forming Full adjacency with every other router (which scales as n-squared), all routers form adjacency only with the DR and BDR. The DR collects LSAs and distributes them to all routers on the segment. Election: highest OSPF priority wins (default 1, 0 = never elected). Tie goes to highest Router ID.
O routes are intra-area — the destination is in the same OSPF area as the router learning the route. O IA routes are inter-area — the destination is in a different OSPF area, and the route was learned through an ABR. O E1 and O E2 are external routes redistributed into OSPF from another routing protocol or static route.
OSPF cost = 10^8 / interface bandwidth in bps. The default reference bandwidth is 100 Mbps (10^8). Any interface at or above 100 Mbps gets cost 1, making GigE and 10GigE appear equal. Change the reference bandwidth with 'auto-cost reference-bandwidth <value>' (in Mbps) on all routers consistently — typically 1000 for GigE networks or 10000 for 10GigE.
CCNA OSPF questions cover neighbor formation prerequisites, DR/BDR election, route types (O vs O IA vs O E2), cost calculation and path selection, troubleshooting adjacency failures, and the role of Area 0 and ABRs in multi-area OSPF. Expect both conceptual questions and simulation-style questions where you identify why two routers won't become neighbors.
Try free OSPF practice questions with explanations, topic links and progress tracking.