The Routing Protocol That Took Me Three Attempts to Actually Understand
I’m going to be upfront about something: OSPF was the topic I avoided the longest during my CCNA studies. I’d read a chapter, feel like I understood it, then look at a practice question involving DR/BDR election on a multi-access segment and realize I understood nothing. This happened three separate times before something finally clicked.
The problem wasn’t that OSPF is impossibly complex. It’s that most explanations dump every concept on you simultaneously, like someone trying to teach you to drive by explaining the internal combustion engine first. You end up knowing a lot of vocabulary and very little about how the thing actually works.
So this is OSPF the way I finally learned it: one layer at a time, with the exam-relevant pieces called out explicitly, and with the real-world context that makes the protocol’s decisions make sense instead of feeling arbitrary.
What OSPF Actually Does and Why It Replaced Everything Else on the CCNA
Open Shortest Path First (OSPF) is a link-state routing protocol. That description won’t mean much until you’ve seen a distance-vector protocol for comparison, so here’s the short version: older routing protocols like RIP sent their entire routing table to their neighbors every 30 seconds and let each router figure out the best path based on hop count alone. A path through ten 10-Gbps links and a path through three 56-Kbps links? RIP would pick the 56-Kbps path because it had fewer hops. That’s obviously a terrible decision, and it’s one of the many reasons RIP isn’t taken seriously in modern networks.
OSPF works differently. Instead of sharing routing tables, each OSPF router builds a complete map of the network topology by exchanging Link-State Advertisements (LSAs). Every router in an OSPF area has the same map. Then each router independently runs Dijkstra’s Shortest Path First algorithm against that map to calculate the best path to every destination. The “best path” is determined by cost, which is derived from bandwidth. A 1-Gbps link has a lower cost than a 100-Mbps link, which means OSPF makes routing decisions that actually reflect real network performance.
The CCNA 200-301 exam focuses on OSPF version 2 (for IPv4) and touches on OSPFv3 (for IPv6). Cisco dropped EIGRP from the CCNA exam blueprint when they consolidated to the single 200-301 exam in 2020, which means OSPF is now the only routing protocol you need to know at exam depth. The relevant exam objectives fall under section 3.4: “Configure and verify single area OSPFv2,” including neighbor adjacencies, point-to-point and broadcast network types, router ID, and passive interfaces.
How OSPF Routers Find Each Other
OSPF routers don’t just start exchanging routes the moment you enable the protocol. They go through a specific process to discover neighbors and form adjacencies, and the exam expects you to understand each step.
It starts with Hello packets. When OSPF is enabled on an interface, the router sends Hello packets to the multicast address 224.0.0.5 (AllSPFRouters) on that interface. These Hellos contain critical information: the router’s Router ID, the area the interface belongs to, the Hello and Dead timers, the subnet mask, the authentication type, and a few other parameters. When another OSPF router on the same segment receives a Hello, it checks whether several parameters match. If the Hello interval, Dead interval, area ID, subnet mask, and authentication settings all agree, the two routers can become neighbors.
This matching requirement is where a huge percentage of OSPF troubleshooting problems live, and it’s where the exam loves to test you. If two routers can ping each other but won’t form an OSPF adjacency, the answer is almost always a mismatch in one of those parameters. The Dead timer defaults to four times the Hello timer (10-second Hello, 40-second Dead on broadcast networks), and if one router has a Hello of 10 and another has a Hello of 15, they’ll never become neighbors. Same with mismatched subnet masks or area IDs. I can’t overstate how often this comes up. On the actual exam and in real production troubleshooting, timer and area mismatches are the number one reason OSPF adjacencies fail.
The Adjacency Process: From Down to Full
Once two routers recognize each other through Hellos, they go through a series of states before they’re fully adjacent. The CCNA doesn’t require you to memorize every transition in granular detail, but understanding the flow helps you interpret show ip ospf neighbor output, which the exam will show you.
The states progress roughly like this. A router starts in the Down state, meaning it hasn’t heard from the neighbor yet. When it receives a Hello, it moves to Init. When it sees its own Router ID listed in the neighbor’s Hello (meaning the neighbor acknowledges it), it moves to 2-Way. At the 2-Way state, the routers decide whether they need to exchange databases. On point-to-point links, they always proceed. On broadcast networks (like a typical Ethernet LAN), only the Designated Router (DR) and Backup Designated Router (BDR) go further; all other routers stop at 2-Way with each other.
If the routers proceed past 2-Way, they enter ExStart, where they negotiate who sends database information first. Then Exchange, where they swap Database Description (DBD) packets summarizing their link-state databases. Then Loading, where they request any LSAs they’re missing. Finally Full, which means both routers have identical link-state databases and the adjacency is complete.
In practice, when you run show ip ospf neighbor and see “FULL” next to a neighbor, everything is working. If you see a neighbor stuck in “2-WAY,” that’s normal on a multi-access segment for non-DR/BDR routers. If you see “EXSTART” or “EXCHANGE” and it stays there, something is wrong with the database exchange, often an MTU mismatch between the two interfaces.
Router ID: The Thing Nobody Explains Well
Every OSPF router needs a Router ID (RID), which is a 32-bit number written in dotted decimal notation that looks like an IP address but doesn’t have to be one. The Router ID uniquely identifies each router in the OSPF domain. OSPF uses a specific priority order to select it.
If you manually configure a Router ID with the router-id command under the OSPF process, that’s what gets used. Period. If you don’t configure one manually, OSPF picks the highest IP address on any active loopback interface. If there are no loopback interfaces, it picks the highest IP address on any active physical interface.
This selection process seems simple enough until it causes problems. The classic issue: you configure OSPF, it picks a Router ID from a physical interface, you later add a loopback with a higher IP, and OSPF doesn’t update its Router ID until you either clear the OSPF process (clear ip ospf process) or reload the router. Meanwhile, you’re staring at show ip ospf wondering why the Router ID doesn’t match what you expect. The exam tests this. If a question asks what Router ID a router will use, pay attention to whether the OSPF process has been restarted since the loopback was configured.
The other place Router ID matters is in the DR/BDR election, which uses the Router ID as a tiebreaker. More on that next.
DR and BDR: The Election That Confuses Everyone
On broadcast multi-access networks (like a standard Ethernet segment where multiple routers share the same subnet), OSPF would create a mess if every router tried to form a full adjacency with every other router. With five routers on a segment, that’s ten adjacencies, and each one involves full database synchronization. It doesn’t scale.
OSPF solves this by electing a Designated Router (DR) and a Backup Designated Router (BDR). All other routers on the segment (called DROthers) form full adjacencies only with the DR and BDR. DROthers stay in the 2-Way state with each other. This dramatically reduces the number of adjacencies and the amount of flooding traffic.
The election works like this: each router’s OSPF priority on that interface is compared. Default priority is 1. Highest priority wins. If priorities are tied, the highest Router ID breaks the tie. A priority of 0 means “I refuse to be DR or BDR,” which is how you keep a low-end access switch from accidentally winning the election on a segment where it doesn’t belong.
Here’s the part that trips up almost every CCNA candidate: the DR/BDR election is non-preemptive. If a router with a higher priority joins the network after the election has already happened, it does NOT become the new DR. The existing DR keeps its role until it goes down. This is a favorite exam question because it’s counterintuitive. You’d expect the “better” router to take over, but OSPF deliberately avoids that because changing the DR would force every router on the segment to re-form adjacencies and re-synchronize databases. Stability beats optimality here.
On point-to-point links (like a serial connection between two routers, or a tunnel), there’s no DR/BDR election at all. There are only two routers, so they just form a full adjacency directly. This is worth remembering because the exam will sometimes ask about DR/BDR behavior on a point-to-point link, and the correct answer is that it doesn’t apply.
OSPF Areas and Why the CCNA Keeps It Simple
OSPF uses areas to organize the network into smaller segments, which limits the size of the link-state database each router has to maintain and reduces the amount of LSA flooding. Every OSPF network has at least one area: Area 0, also called the backbone area. In a multi-area design, all other areas must connect to Area 0 either directly or through a virtual link.
The CCNA 200-301 exam objective specifically says “single area OSPFv2.” That means you need to understand what areas are and why they exist, but the configuration and troubleshooting questions will focus on a single-area design where everything lives in Area 0. You won’t be tested on configuring multi-area OSPF, inter-area route summarization, or different LSA types at the CCNA level. That’s CCNP territory.
What you do need to know is that the area ID must match between neighbors for an adjacency to form. If Router A’s interface is in Area 0 and Router B’s interface on the same segment is in Area 1, they won’t become neighbors. This is another one of those mismatch scenarios that shows up repeatedly on practice exams.
Configuring Single-Area OSPF: The Actual Commands
The configuration itself is surprisingly concise for a protocol this sophisticated. Here’s what a basic single-area OSPFv2 setup looks like on a Cisco router.
You enter the OSPF routing process with router ospf process-id. The process ID is locally significant, which means it doesn’t have to match between routers. Router A can use process ID 1 and Router B can use process ID 10 and they’ll still form an adjacency just fine. This confuses people who assume it works like an area ID or an AS number, but it doesn’t. It’s just a label for the local OSPF instance.
Inside the OSPF process, you advertise networks with the network command: network ip-address wildcard-mask area area-id. The wildcard mask tells OSPF which interfaces to activate the protocol on by matching against each interface’s IP address. If you have an interface with IP 10.0.1.1/24, you could match it with network 10.0.1.0 0.0.0.255 area 0 or even network 10.0.1.1 0.0.0.0 area 0 to match that exact IP. The wildcard mask here is not a subnet mask. It’s an inverse mask where 0 bits must match and 1 bits are “don’t care.” If you’re comfortable with subnetting and binary math, wildcard masks will feel familiar but backwards.
You can also set the Router ID manually with router-id x.x.x.x, which I recommend doing in any environment where predictability matters. And you should configure passive interfaces on any interface that doesn’t connect to another OSPF router (like a LAN segment facing end users) with passive-interface interface-id. Passive interfaces still advertise their networks into OSPF, but they stop sending Hello packets, which means no OSPF adjacency will form on that interface. This is both a security measure (you don’t want random devices trying to become OSPF neighbors on your user VLAN) and a resource saver.
OSPF Cost and How Routes Get Chosen
OSPF’s metric is cost. The cost of an interface is calculated as the reference bandwidth divided by the interface bandwidth. By default, the reference bandwidth is 100 Mbps. That means a 100-Mbps FastEthernet interface has a cost of 1 (100/100), a 10-Mbps Ethernet interface has a cost of 10 (100/10), and a 1-Gbps interface also has a cost of… 1 (100/1000, rounded up to 1).
That’s a problem. With the default reference bandwidth, OSPF treats a 100-Mbps link and a 10-Gbps link as having the same cost. In any network with Gigabit or faster links (which in 2026 is basically every network), you should change the reference bandwidth to something higher using auto-cost reference-bandwidth value under the OSPF process. Setting it to 10000 (for 10 Gbps) or 100000 (for 100 Gbps) gives you meaningful cost differentiation. The critical requirement: you have to set the same reference bandwidth on every router in the OSPF domain, or your cost calculations won’t be consistent and routing decisions will be unpredictable.
The total cost of a route is the sum of all interface costs along the path from the router to the destination. When OSPF runs Dijkstra’s algorithm, it calculates the total cost to every destination and installs the lowest-cost path into the routing table. If two paths have equal cost, OSPF will load-balance across them by default (up to four equal-cost paths, configurable up to 32 with the maximum-paths command).
The show Commands You Need to Know Cold
OSPF troubleshooting on the CCNA comes down to interpreting output from a handful of commands. Know these well enough that you can glance at the output and identify what’s normal and what’s broken.
show ip ospf neighbor is your starting point. It shows every OSPF neighbor, their state (FULL, 2WAY, INIT, etc.), their Router ID, the interface you’re connected through, and the Dead timer countdown. If a neighbor is missing from this list entirely, the issue is at the Hello level: wrong area, wrong timers, wrong subnet, or the interface isn’t participating in OSPF at all. If a neighbor appears but is stuck in INIT, the neighbor is hearing your Hellos but you’re not hearing theirs (usually an ACL or firewall blocking OSPF multicast). If it’s stuck in EXSTART, check for MTU mismatch.
show ip ospf interface interface-id tells you the OSPF details for a specific interface: the area, the network type, the cost, the Hello and Dead timers, the DR/BDR addresses on that segment, and whether the interface is passive. This is where you confirm that your timers and area assignments are what you think they are.
show ip route ospf shows only the OSPF-learned routes in the routing table. Each route will show the administrative distance (110 for OSPF) and the metric (cost), along with the next-hop address and outgoing interface. If a route you expect to see isn’t there, the issue is either that the adjacency isn’t forming, the network isn’t being advertised on the remote router, or a better route from a different source (with a lower administrative distance) exists.
show ip ospf without any additional keywords gives you the OSPF process overview: Router ID, reference bandwidth, area information, and SPF calculation statistics. Check this when you need to verify the Router ID or confirm the reference bandwidth setting.
show ip protocols is a broader command that shows all running routing protocols, including OSPF. It lists which networks are being advertised, the Router ID, the administrative distance, and which interfaces are passive. Useful when you want a quick summary of the OSPF configuration without diving into interface-level details.
The Troubleshooting Scenarios the Exam Loves
After working through hundreds of OSPF questions across multiple practice exam platforms, I can tell you the exam keeps returning to the same failure patterns. If you can diagnose these, you can handle anything the CCNA throws at you on this topic.
Neighbors won’t form an adjacency. Check the Hello/Dead timers on both sides. Check the area ID. Check the subnet mask. Check that OSPF is actually enabled on the interface (run show ip ospf interface and make sure the interface shows up). Check that the interface isn’t configured as passive on one side. One of these will be wrong. On the exam, the question will usually give you show command output from both routers and one parameter will be different.
A route is missing from the routing table. Verify the adjacency is FULL with show ip ospf neighbor. Then check that the remote router is actually advertising the network. A common exam trick is to show a router with a connected network that isn’t included in any network statement, so OSPF never advertises it. Another trick: the network is advertised but with the wrong area ID, which matters in multi-area setups but can still cause confusion in single-area questions if a router has an interface accidentally placed in a different area.
OSPF cost is wrong and traffic takes a suboptimal path. Check the reference bandwidth. If it’s default (100 Mbps) and the network has Gigabit links, that’s probably the issue. Also check if someone manually set the cost on an interface with ip ospf cost, which overrides the calculated value.
DR/BDR election doesn’t match expectations. Remember: non-preemptive. The router with the highest priority (or highest RID as a tiebreaker) that was present when the election happened is the DR. A higher-priority router added later won’t take over. Check priorities with show ip ospf interface.
These scenarios repeat with minor variations. The exam isn’t trying to invent novel OSPF problems. It’s testing whether you can systematically work through the protocol’s logic using show commands. If you want to drill this systematically, Boson ExamSim is where I’d point you. Their OSPF troubleshooting questions present realistic multi-router scenarios with show command output, and the explanations walk through the entire adjacency and route advertisement process when you get one wrong. That repetition is what finally made the protocol click for me.
OSPFv3: The IPv6 Version (Brief but Necessary)
The CCNA touches on OSPFv3, which is OSPF for IPv6. The core logic is the same: link-state advertisements, Dijkstra’s algorithm, areas, DR/BDR elections, adjacency formation. The key differences are that OSPFv3 uses IPv6 link-local addresses for neighbor communication instead of IPv4 addresses, it’s enabled per-interface rather than using the network command, and the Router ID is still a 32-bit value that looks like an IPv4 address even though the protocol routes IPv6 traffic. If you’ve been studying IPv6 for the exam, OSPFv3 is a natural extension.
The exam is unlikely to go deep on OSPFv3 configuration specifics, but you should know that it exists, what makes it different from OSPFv2, and that it operates over IPv6 link-local addresses.
How I Finally Learned OSPF (After Failing at It Repeatedly)
The third time I came back to OSPF, I changed my approach completely. Instead of reading the chapter start to finish, I set up a simple three-router topology in Packet Tracer and configured basic OSPF with nothing else running. No VLANs, no ACLs, no NAT. Just three routers, three directly connected networks, and OSPF Area 0.
I broke it on purpose. Changed the Hello timer on one side and watched the adjacency drop. Misconfigured the area ID and watched the neighbor table go empty. Set one interface as passive and watched the adjacency disappear even though pings still worked. Each time, I ran the show commands, looked at the output, and connected what I saw to what I’d broken.
Then I added complexity gradually. Added a fourth router. Changed interface bandwidths and watched the routing table update. Manipulated OSPF priorities and observed the DR/BDR election. Put a network statement in the wrong area and troubleshot until I found it.
That incremental approach, building from a working baseline and intentionally breaking one thing at a time, taught me more in a weekend than three read-throughs of the textbook chapter. If you’re building your own home lab, OSPF is one of the most rewarding protocols to practice because the show command output is detailed enough to tell you exactly what went wrong if you know how to read it.
OSPF is 25% of the CCNA exam under IP Connectivity. It’s not something you can skim. But it’s also not the monster it seems like on first contact. The protocol follows a logical sequence: find neighbors, exchange maps, calculate best paths, install routes. Every feature and every failure mode ties back to that sequence. Once you see it that way, the individual pieces stop feeling random and start fitting together. That’s when you know you’re ready.

Network Professional | CCNA Certified
Ashley Miller is a 35-year-old networking professional with a proven foundation in Cisco technologies. She is CCNA certified and currently advancing her expertise by working toward the Cisco Certified Network Professional (CCNP) certification. With a passion for designing and maintaining efficient, secure network infrastructures, Ashley brings both technical skill and real-world experience to every project.













