OSPF is the most heavily tested routing protocol on CCNA 200-301. Beyond basic configuration, the exam goes deep: DR/BDR election, router ID selection, neighbor adjacency states, network types (point-to-point vs broadcast), and OSPFv3 for IPv6. This guide covers the details that separate passing CCNA candidates from those who struggle with OSPF scenario questions.
Practice this topic
OSPF is a link-state routing protocol that builds a complete map of the network topology in each router's Link-State Database (LSDB). Routers exchange Link-State Advertisements (LSAs) describing their directly connected links. Each router runs the Dijkstra SPF algorithm on its LSDB to calculate the shortest path to every destination.
OSPF uses multicast for hello packets and LSA flooding: 224.0.0.5 (all OSPF routers) and 224.0.0.6 (all Designated Routers). OSPF runs directly over IP protocol number 89 — not TCP or UDP. OSPF areas allow large networks to be divided into smaller domains that limit LSA flooding scope. Area 0 (backbone area) must connect all other areas.
Every OSPF router has a Router ID (RID) — a 32-bit number written in dotted decimal format that uniquely identifies it in the OSPF domain. The RID is not an IP address used for routing — it's an identifier. However, it is selected using IP address rules.
RID selection order: (1) Manually configured RID with `router-id <x.x.x.x>` — always preferred. (2) Highest loopback interface IP address. (3) Highest active physical interface IP address. The key word is 'highest' — not the first configured, not the management interface, but the numerically highest IP.
Always configure the RID manually in production. RID instability (changing because an interface came up with a higher IP) causes OSPF reconvergence. Loopback interfaces are UP/UP as long as the router is running — they provide a stable RID source even if physical interfaces go down.
On multi-access broadcast networks (Ethernet), all OSPF routers would form adjacencies with every other router, resulting in N*(N-1)/2 adjacencies. For 5 routers, that's 10 full adjacencies, each maintaining synchronized LSDBs. This doesn't scale.
OSPF solves this with Designated Router (DR) and Backup Designated Router (BDR) election. All routers form full adjacency only with the DR and BDR. Other routers (DROther) form 2-way relationships with each other but don't fully synchronize LSDBs. LSAs are sent to 224.0.0.6 (AllDRRouters) and the DR redistributes to 224.0.0.5 (AllSPFRouters).
DR/BDR election: the router with the highest OSPF interface priority wins DR (default priority = 1). Ties are broken by Router ID. Priority 0 means the router never becomes DR or BDR — useful to prevent access layer switches from becoming DR.
Critical point: DR/BDR election is non-preemptive. Once elected, a DR keeps its role until it fails, even if a router with a higher priority/RID comes online later. To force a new election, the existing DR must be removed from the network.
OSPF neighbors progress through states before full adjacency. The states: Down → Init → 2-Way → Exstart → Exchange → Loading → Full.
Down: no hellos received. Init: hello received, but our router ID isn't in the neighbor's hello. 2-Way: bidirectional communication confirmed (both Router IDs in each other's hellos); DR/BDR election occurs at this state. Exstart: master/slave relationship established for LSDB exchange. Exchange: routers exchange Database Description (DBD) packets summarizing their LSDB. Loading: one router requests LSAs it's missing. Full: LSDBs are synchronized — full adjacency achieved.
On broadcast networks, DROther routers only reach Full state with the DR and BDR. With other DROthers they remain at 2-Way. On point-to-point links, there is no DR/BDR — both routers reach Full state directly.
A stuck neighbor (not reaching Full) is a common CCNA troubleshooting scenario. Causes: MTU mismatch (Exchange/Loading stuck), area ID mismatch, authentication mismatch, hello/dead timer mismatch, or duplicate Router IDs.
OSPF network type determines whether DR/BDR election occurs and how hellos are sent. The two most important: Broadcast (default on Ethernet) — uses multicast hellos, elects DR/BDR. Point-to-Point (default on serial links and recommended on point-to-point Ethernet links) — no DR/BDR, uses multicast hellos, both routers reach Full adjacency directly.
On point-to-point links, DR/BDR election is unnecessary and wastes convergence time. Configure `ip ospf network point-to-point` on both ends of a point-to-point Ethernet link to skip DR/BDR election and speed up adjacency formation.
OSPFv3 is OSPF for IPv6. The configuration is similar but uses IPv6 addresses and the `ipv6 ospf` command set. OSPFv3 uses link-local addresses as the source for hello packets and supports multiple address families in newer implementations.
| Network type | Default interface | DR/BDR? | Hello interval | Dead interval |
|---|---|---|---|---|
| Broadcast | Ethernet | Yes | 10 sec | 40 sec |
| Point-to-point | Serial, p2p Ethernet | No | 10 sec | 40 sec |
| Non-broadcast (NBMA) | Frame Relay (legacy) | Yes | 30 sec | 120 sec |
| Point-to-multipoint | Hub-spoke WAN | No | 30 sec | 120 sec |
A router with a higher RID always becomes DR
The router with the highest OSPF interface priority becomes DR. RID only breaks ties when priorities are equal. Setting priority to 0 prevents a router from ever becoming DR regardless of RID.
When a new router with the highest priority joins, it becomes the new DR immediately
DR/BDR election is non-preemptive. The current DR keeps its role until it leaves the network. The high-priority new router becomes BDR (if BDR is open) and only becomes DR after the current DR fails.
All OSPF routers on a broadcast segment reach Full adjacency with each other
Only DR and BDR reach Full adjacency with all routers. DROther routers form Full adjacency only with the DR and BDR. Between themselves, DROthers stay at 2-Way state.
These questions are representative of what you will see on CCNA exams. The correct answer and explanation are shown immediately below each question.
Three OSPF routers are on the same Ethernet segment. Router A has priority 0, Router B has priority 2, Router C has priority 1. Which router becomes the DR?
Explanation: The router with the highest OSPF interface priority becomes DR. Router B (priority 2) has the highest priority. Router A (priority 0) is ineligible for DR/BDR. Priority 2 is valid — the range is 0–255.
An OSPF router has no loopback interfaces and three physical interfaces: 10.0.0.1, 172.16.1.1, and 192.168.1.1, all active. No RID is manually configured. What is the Router ID?
Explanation: Without a manually configured RID or loopback interfaces, OSPF uses the numerically highest active physical interface IP as the Router ID. 192.168.1.1 is the highest of the three IPs.
A DROther OSPF router should be in which adjacency state with another DROther router on the same broadcast segment?
Explanation: DROther routers form 2-Way adjacency with each other — they see each other's hellos and Router IDs but do not fully synchronize their LSDBs. Full adjacency is only formed between DROther routers and the DR/BDR.
Which OSPF packet type is used to summarize a router's LSDB during the Exchange state?
Explanation: During the Exchange state, routers exchange Database Description (DBD) packets that summarize the contents of their LSDBs. Routers compare DBDs and request any missing LSAs using LSR (Link-State Request) in the Loading state.
Which command configures an Ethernet interface to use OSPF point-to-point network type, eliminating DR/BDR election?
Explanation: ip ospf network point-to-point changes the OSPF network type on the interface to point-to-point, which skips DR/BDR election and allows both ends to form Full adjacency directly. ip ospf priority 0 prevents a router from becoming DR/BDR but doesn't change the network type.
OSPF selects the Router ID in this order: (1) Manually configured with `router-id` command — always wins. (2) Highest IP address on a loopback interface. (3) Highest IP address on an active physical interface. Manual configuration is strongly recommended to prevent instability when interfaces change state.
On multi-access broadcast networks (Ethernet), the DR (Designated Router) and BDR (Backup Designated Router) reduce the number of adjacencies. Instead of N*(N-1)/2 full adjacencies, all routers form full adjacency only with the DR and BDR. The DR redistributes LSAs to all routers, and the BDR monitors the DR to take over if it fails.
The most common cause is an MTU mismatch. If two routers have different interface MTUs, DBD packets larger than the smaller MTU are dropped, preventing LSDB exchange. Other causes: mismatched OSPF network types, duplicate Router IDs, or authentication mismatches. Check with `show interfaces` for MTU and `show ip ospf neighbor` for the stuck state.
Broadcast (default on Ethernet) elects a DR and BDR; routers send hellos to 224.0.0.5 and LSAs to 224.0.0.6. Point-to-point has no DR/BDR; both routers form Full adjacency directly. For Ethernet links connecting only two routers, `ip ospf network point-to-point` simplifies adjacency and speeds convergence.
The Router ID is a 32-bit number expressed in dotted decimal (like an IP address) but it doesn't have to match an actual interface IP. When manually configured with `router-id`, you can use any unique value like 1.1.1.1 or 0.0.0.1. Using simple values like 1.1.1.1 per-router makes troubleshooting much easier than relying on interface IPs.
Try free OSPF Detail practice questions with explanations, topic links and progress tracking.