OSPF practice questions with answers

Updated October 9, 2026

Fifteen free OSPF practice questions with explained answers, covering neighbor states, what must match between routers, DR and BDR election, router ID selection and cost. OSPF (Open Shortest Path First) is a link-state routing protocol in which routers share a map of the network and choose the lowest-cost path. It is tested on the CCNA 200-301 as single-area OSPFv2 and named in lighter form on CompTIA Network+ N10-009. All questions assume OSPFv2 on Cisco IOS with default settings unless the stem says otherwise.

How to use these questions

Attempt each question before opening the answer, and decide which single parameter or state the stem is pointing at. Note the constraint words: the neighbor state shown, “default”, “added later” and “same time” change the answer. The reference tables for states, timers and election rules are in OSPF explained.

Warm-up: states, timers and router ID

Question 1. Three routers share one Ethernet segment, and OSPF is running correctly. R2 and R3 are both DROthers, and show ip ospf neighbor on R2 lists R3 in the 2-Way state. What does this indicate?

  • A. An MTU mismatch between R2 and R3
  • B. Normal operation between two DROthers
  • C. R3 has not received any Hello from R2
  • D. A mismatched Hello interval between R2 and R3
Show answer

Answer: B

On a broadcast segment only the DR and BDR form full adjacencies with every router. Two DROthers remain in 2-Way with each other, which is the normal and correct state. It is not a fault, so there is no mismatched MTU or timer to fix. A router stuck in Init has not yet seen its own ID in the other router’s Hello. Full is reached only with the DR and BDR.

Question 2. On a default Cisco IOS router, which Hello and dead intervals does OSPFv2 use on a Gigabit Ethernet interface?

  • A. Hello 5 seconds, dead 20 seconds
  • B. Hello 30 seconds, dead 120 seconds
  • C. Hello 10 seconds, dead 30 seconds
  • D. Hello 10 seconds, dead 40 seconds
Show answer

Answer: D

On broadcast and point-to-point network types the defaults are a 10-second Hello and a 40-second dead interval, four times the Hello. 5 and 20 are not defaults. 30 and 120 are the defaults on non-broadcast network types. A dead interval of 30 seconds would not be four times the Hello.

Question 3. How are OSPFv2 packets carried between routers?

  • A. Directly over IP, protocol number 89
  • B. Over TCP port 179
  • C. Over UDP port 89
  • D. Over TCP port 89
Show answer

Answer: A

OSPF runs directly over IP as protocol number 89, as defined in RFC 2328. It does not use TCP or UDP, so there is no port number to open in a filter. UDP port 89 and TCP port 89 do not exist for OSPF. TCP port 179 belongs to BGP.

Question 4. An IOS router has no router-id command configured. Loopback0 (up) has 1.1.1.1, GigabitEthernet0/0 (up) has 10.0.0.9, and GigabitEthernet0/1 (up) has 192.168.1.1. Which router ID does OSPF use?

  • A. 192.168.1.1
  • B. 10.0.0.9
  • C. 1.1.1.1
  • D. 0.0.0.0
Show answer

Answer: C

Without a configured router-id, OSPF uses the highest IPv4 address on an up loopback interface. 1.1.1.1 is used even though it is numerically lower than the physical addresses. Physical interfaces are considered only when no loopback is up, which is why 192.168.1.1 is not chosen. 10.0.0.9 is neither. 0.0.0.0 is not a valid router ID.

Question 5. A network uses Fast Ethernet and Gigabit Ethernet links, and OSPF is left at the default reference bandwidth. Routers always treat a path over Fast Ethernet links as equal to a path over Gigabit links of the same hop count. Which change makes OSPF prefer the faster links?

  • A. Lower the Hello interval on the Gigabit links
  • B. Raise the OSPF priority on the Gigabit interfaces
  • C. Raise the reference bandwidth with auto-cost reference-bandwidth on all routers
  • D. Configure a new router ID on each router
Show answer

Answer: C

With the default reference bandwidth of 100 Mbps, Fast Ethernet and anything faster all cost 1, so the paths look equal. Raising auto-cost reference-bandwidth, for example to 10000 on every router, gives Gigabit a cost of 10 and Fast Ethernet 100. Changing Hello timers does not alter cost. The DR priority affects only the election. Changing the router ID has no effect on path selection.

Scenarios: stuck neighbors and elections

Question 6. On R1, show ip ospf neighbor lists R2 in the INIT state and never advances. Timers, area and mask are known to match. What is the most likely cause?

  • A. Hellos from R1 are not reaching R2, for example an ACL drops them
  • B. The interface MTU differs on the two routers
  • C. The Hello timers differ on the two routers
  • D. Both routers use the same router ID
Show answer

Answer: A

INIT means R1 has received a Hello from R2 but that Hello does not list R1’s router ID, so Hellos from R1 are not reaching R2. Something is dropping traffic in that direction, such as an ACL or a one-sided configuration problem. An MTU mismatch shows in ExStart or Exchange, after the Hello exchange works in both directions. A timer mismatch would make R1 discard R2’s Hellos, so R2 would not be listed. A duplicate router ID also shows up later, during the database exchange.

Question 7. R1 and R2 show each other in the EXSTART state, and the Hellos, area and timers match. The link between them is a tunnel on R1 with MTU 1400 and a Gigabit port on R2 with MTU 1500. What should be checked or changed?

  • A. Raise the OSPF priority on R1
  • B. Change the Hello interval on R2
  • C. Move the tunnel into a different area
  • D. Make the MTU equal on both ends of the link
Show answer

Answer: D

Neighbors that stall in ExStart or Exchange usually have different interface MTUs, because the database description packets sized for one MTU are dropped by the other side. Making the MTU equal, or using ip ospf mtu-ignore as a workaround, resolves it. Changing priority affects only the DR election. Changing the Hello interval would not help because Hellos are already being exchanged. Changing the area would stop the Hello exchange altogether.

Question 8. Three routers on one Ethernet segment power up at the same moment with default timers. R1 has priority 1 and router ID 9.9.9.9. R2 has priority 100 and router ID 1.1.1.1. R3 has priority 50 and router ID 5.5.5.5. Which roles result?

  • A. R1 is the DR and R2 is the BDR
  • B. R2 is the DR and R3 is the BDR
  • C. R3 is the DR and R2 is the BDR
  • D. R1 is the DR and R3 is the BDR
Show answer

Answer: B

The highest priority wins the election, and the router ID is used only to break a tie. R2 has priority 100, so it becomes the DR, and R3 with priority 50 becomes the BDR. R1 has the highest router ID, but that applies only when priorities are equal, and R1 is left as a DROther. The other options choose by router ID or reverse the DR and BDR.

Question 9. R1 is the DR and R2 is the BDR on a segment that has been stable for days. A new router R4 with OSPF priority 200 joins the segment. What happens to the DR role?

  • A. R1 stays the DR, and R4 becomes a DROther
  • B. R4 becomes the DR immediately
  • C. R4 becomes the BDR and R2 becomes a DROther
  • D. A new election starts and R4 wins it
Show answer

Answer: A

The DR election is not preemptive. R4 joins an existing election result and takes the DROther role, regardless of its higher priority. R1 remains the DR and R2 remains the BDR until one of them fails or the OSPF process is cleared. R4 does not become DR immediately, and the BDR is not replaced either. Priority only matters when an election takes place.

Question 10. The reference bandwidth is the default 100 Mbps. R1 connects to R2 over Fast Ethernet, R2 connects to R3 over a 10 Mbps Ethernet link, and 10.9.0.0/24 is attached to R3 on a Gigabit Ethernet interface. Taking the cost of the interface on the destination network into account, what is the OSPF metric on R1 for 10.9.0.0/24?

  • A. 3
  • B. 10
  • C. 12
  • D. 11
Show answer

Answer: C

With a 100 Mbps reference, Fast Ethernet costs 1, 10 Mbps Ethernet costs 10 and Gigabit costs 1, because the cost never falls below 1. The path totals 1 + 10 + 1 = 12. A total of 3 treats the 10 Mbps link as cost 1. A total of 10 counts only the slowest link. A total of 11 leaves out the cost of R3’s interface on the destination network.

Edge cases and traps: configuration and election details

Question 11. R1 is configured with ip ospf hello-interval 5 on its link, while R2 uses the default 10 seconds. Everything else matches. What does show ip ospf neighbor show on R1?

  • A. R2 in the INIT state
  • B. No entry for R2 at all
  • C. R2 in the EXSTART state
  • D. R2 in the FULL state
Show answer

Answer: B

A router discards Hellos whose Hello or dead interval differs from its own, so the neighbor is never created. The neighbor does not appear in the table at all, not even in INIT, which is a state that needs a valid Hello to have been received. ExStart and 2-Way both come after a successful Hello exchange. Full requires a complete database exchange.

Question 12. R1 has GigabitEthernet0/1 configured as 172.16.4.1/30. R2, on the other end, runs OSPF on its interface in area 0. Which network statement on R1 enables OSPF on this interface in the same area?

  • A. network 172.16.4.0 0.0.0.3 area 1
  • B. network 172.16.4.4 0.0.0.3 area 0
  • C. network 172.16.4.0 0.0.0.3 area 0
  • D. network 172.16.4.2 0.0.0.0 area 0
Show answer

Answer: C

A network statement matches interface addresses using a wildcard mask. 172.16.4.0 0.0.0.3 matches 172.16.4.0 to 172.16.4.3, which includes 172.16.4.1, and area 0 matches R2. Using area 1 would put the interface in a different area and prevent the adjacency. 172.16.4.4 0.0.0.3 matches 172.16.4.4 to 172.16.4.7, which does not include R1’s address. 172.16.4.2 0.0.0.0 matches only R2’s address.

Question 13. R1's GigabitEthernet0/2 connects only to end users. The subnet must be advertised in OSPF, but R1 must not send Hellos or form neighbors on that interface. Which configuration under router ospf achieves this?

  • A. Remove the network statement that covers the interface
  • B. Set ip ospf priority 0 on the interface
  • C. Increase the dead interval on the interface
  • D. passive-interface GigabitEthernet0/2
Show answer

Answer: D

The passive-interface command stops Hellos on an interface while the network it belongs to is still advertised through a matching network statement. Removing the network statement would stop the subnet from being advertised. Setting priority to 0 only keeps the router out of the DR election and still sends Hellos. Raising the dead interval does not stop Hellos.

Question 14. Two routers are connected directly by an Ethernet link and the administrator does not want a DR and BDR election on this link. Which command on both interfaces does this?

  • A. ip ospf network point-to-point
  • B. ip ospf priority 0 on both interfaces
  • C. A passive-interface setting on both interfaces
  • D. ip ospf hello-interval 40
Show answer

Answer: A

Setting the network type to point-to-point with ip ospf network point-to-point removes the DR and BDR election, and the neighbors move directly to Full. Priority 0 on both routers would leave no router able to become DR, and it does not change the network type. A passive interface sends no Hellos, so no adjacency forms. Setting the Hello interval to 40 changes timers only and the election still happens.

Question 15. Three routers power up together on one Ethernet segment. R1 has priority 0 and router ID 3.3.3.3. R2 has priority 1 and router ID 1.1.1.1. R3 has priority 1 and router ID 2.2.2.2. Which roles result?

  • A. R1 is the DR and R3 is the BDR
  • B. R3 is the DR and R2 is the BDR
  • C. R2 is the DR and R3 is the BDR
  • D. R1 is the BDR and R3 is the DR
Show answer

Answer: B

Priority 0 makes a router ineligible to be the DR or BDR, so R1 stays a DROther even though it has the highest router ID. R2 and R3 tie on priority 1, so the highest router ID decides: R3 (2.2.2.2) becomes the DR and R2 (1.1.1.1) the BDR. R1 cannot be DR or BDR. R2 has the lowest router ID, so it does not win the tie.

Where to go next

Review the full state table and election rules in OSPF explained. For related practice, try the subnetting practice problems and the ACL practice questions, since an ACL is a common reason for a stuck INIT neighbor. Then take the free 20-question CCNA practice test and read the multiple-choice exam tips.