OSPF Troubleshooting Challenge
Lab Objectives
- Configure and verify OSPF (process 1) across a small multi-router topology, including setting fixed router IDs.
- Control DR/BDR elections using ip ospf priority on specific interfaces.
- Troubleshoot and fix common OSPF misconfigurations that prevent adjacency and route exchange.
Lab Tasks (Try It Yourself First!)
Complete these tasks WITHOUT looking at the solution below. Use
?andshowcommands to discover the problem and confirm your fixes.
Task 1: Enable OSPF and advertise connected networks
On each router (R1–R4) start OSPF process 1, set the router-id to 0.0.0.X (X = router number), and advertise each router’s directly connected 10.10.* network(s) in area 10. On R2 also advertise 10.10.40.0/24.
(Parameters: process 1, area 10, router-id 0.0.0.x — do NOT post commands here.)
Task 2: Force DR/BDR election on access segments
Adjust OSPF priorities so that:
- R1 becomes the DR on the 10.10.10.0/24 segment (toward R2).
- R3 becomes the DR on the 10.10.20.0/24 segment (toward R1).
(Parameters: set interface OSPF priorities appropriately and reset OSPF process.)
Task 3: Fix a broken adjacency
One router was misconfigured and is not forming an adjacency — find which one, correct the OSPF network advertisement so all routers form full adjacencies and exchange routes.
Think About It: Why does OSPF require matching area and network advertisement to form adjacencies on multi-access networks? How does the router-id affect how networks are shown in debug or show outputs?
BASE LAB TOPOLOGY (exact IPs on every interface)
[Internet]
203.0.113.1
|
R1 (Gateway)
Gi0/0: 10.10.10.1
Gi0/1: 10.10.20.1
Gi0/2: 10.10.30.1
/ | \
R2 R3 R4
Gi0/0: 10.10.10.2 Gi0/0: 10.10.20.2 Gi0/0: 10.10.30.2
Gi0/1: 10.10.40.1
/ \ |
S1 S2 S3
/ \ | /
PC1 PC2 PC3 PC4 PC5
IP SCHEME (for reference)
- 10.10.10.0/24 — R1-R2 link
- 10.10.20.0/24 — R1-R3 link
- 10.10.30.0/24 — R1-R4 link
- 10.10.40.0/24 — R2-S1 link
- 192.168.1.0/24 — VLAN 10 (Sales)
- 192.168.2.0/24 — VLAN 20 (Engineering)
- 192.168.3.0/24 — VLAN 30 (Management)
- 203.0.113.0/24 — Public/Internet simulation
Lab Solution
Task 1 Solution: Enable OSPF and advertise connected networks
What we are doing: We enable OSPF process 1 on each router, set a stable router-id (for predictable neighbor display and LSA ownership), and advertise each router’s directly connected 10.10.* networks into area 10 so routers discover each other and exchange routes.
! R1
router ospf 1
router-id 0.0.0.1
network 10.10.10.0 0.0.0.255 area 10
network 10.10.20.0 0.0.0.255 area 10
network 10.10.30.0 0.0.0.255 area 10
! R2
router ospf 1
router-id 0.0.0.2
network 10.10.10.0 0.0.0.255 area 10
network 10.10.40.0 0.0.0.255 area 10
! R3
router ospf 1
router-id 0.0.0.3
network 10.10.20.0 0.0.0.255 area 10
! R4
router ospf 1
router-id 0.0.0.4
network 10.10.30.0 0.0.0.255 area 10
What just happened:
router ospf 1— starts OSPF process number 1 on the router. This is the OSPF instance that will form adjacencies and build the LSDB.router-id 0.0.0.X— sets a stable OSPF router identifier. This matters because OSPF uses the router-id as the source of LSAs and it appears in OSPF neighbor displays; a predictable ID simplifies troubleshooting.network <ip> <wildcard> area 10— tells the OSPF process to enable OSPF on interfaces that match the network wildcard and to place those interfaces into area 10. If you omit the correct network, the router will not form adjacencies on that link.
Verify:
! On R1
show ip ospf neighbor
Expected output (complete lines — one line per neighbor):
Neighbor ID Pri State Dead Time Address Interface
0.0.0.2 1 FULL/DR 00:00:32 10.10.10.2 GigabitEthernet0/0
0.0.0.3 1 FULL/DR 00:00:35 10.10.20.2 GigabitEthernet0/1
0.0.0.4 1 FULL/DR 00:00:36 10.10.30.2 GigabitEthernet0/2
! On R2
show ip route ospf
Expected output excerpt:
O 10.10.20.0/24 [110/2] via 10.10.10.1, 00:00:10, GigabitEthernet0/0
O 10.10.30.0/24 [110/2] via 10.10.10.1, 00:00:12, GigabitEthernet0/0
Tip: If a neighbor is missing, check that both sides placed the interface into the same OSPF area and that interface IPs are in the same subnet.
Task 2 Solution: Force DR/BDR election on access segments
What we are doing: OSPF elects a Designated Router (DR) and Backup DR (BDR) on multi-access networks. To control who becomes DR we set per-interface ip ospf priority. Higher priority increases chance to be DR. After changing priority we must reset OSPF process so neighbors see the change.
! Make R1 prefer DR on the 10.10.10.0/24 segment
! On R1
interface GigabitEthernet0/0
ip ospf priority 100
! Lower R2 priority so it becomes BDR
! On R2
interface GigabitEthernet0/0
ip ospf priority 50
! Make R3 prefer DR on the 10.10.20.0/24 segment
! On R3
interface GigabitEthernet0/0
ip ospf priority 100
! On R1 ensure Gi0/1 has a lower priority than R3
! On R1
interface GigabitEthernet0/1
ip ospf priority 50
! Reset OSPF so changes take effect (performed on each router)
clear ip ospf process
What just happened:
interface ... ip ospf priority X— sets the OSPF interface priority; default is 1. A priority of 0 prevents a router from becoming DR/BDR. Changing priority influences the election outcome on that multi-access segment.clear ip ospf process— restarts OSPF on the router, forcing re-election of DR/BDR and reformation of adjacencies. This command is necessary to apply the new priority immediately.
Verify:
! On R1 check OSPF interface details for Gi0/0
show ip ospf interface GigabitEthernet0/0
Expected output excerpt:
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.10.10.1/24, Area 10
Process ID 1, Router ID 0.0.0.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 100
Designated Router (ID) 0.0.0.1, Interface address 10.10.10.1
Backup Designated Router (ID) 0.0.0.2, Interface address 10.10.10.2
! On R3 check its Gi0/0
show ip ospf interface GigabitEthernet0/0
Expected output excerpt:
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.10.20.2/24, Area 10
Process ID 1, Router ID 0.0.0.3, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 100
Designated Router (ID) 0.0.0.3, Interface address 10.10.20.2
Real-world context: In a production LAN with many OSPF speakers (e.g., multiple virtualized routers), you often control DR/BDR so a stable, high-capacity device becomes DR to handle more LSA processing.
Troubleshooting Scenario
Scenario: R2 is not forming adjacency with R1
Symptom: From R1 show ip ospf neighbor you see neighbors R3 and R4, but R2 is missing. Ping between R1 and 10.10.10.2 succeeds at IP level, but OSPF neighbor is not present. PC networks behind R2 are not visible via OSPF.
Your task: Find and fix the issue.
Hint: Check R2’s OSPF network statements — a common mistake is advertising the wrong connected network or wrong area.
Solution:
- On R2 inspect the OSPF configuration. If R2 has an incorrect
networkstatement (for example advertising 10.10.20.0 instead of 10.10.10.0), it will not enable OSPF on Gi0/0 and thus no adjacency forms. - Correct the network statement and restart OSPF process.
! Show current OSPF config (on R2)
show running-config | section router ospf
! If wrong, fix it:
configure terminal
router ospf 1
no network 10.10.20.0 0.0.0.255 area 10 ! (remove the incorrect line)
network 10.10.10.0 0.0.0.255 area 10 ! (advertise the correct link)
end
! Reset OSPF for immediate effect
clear ip ospf process
Why this fixes it: OSPF forms adjacencies only on interfaces the OSPF process is enabled for (via network statements in classic config or via interface-level commands). If R2 did not enable OSPF on Gi0/0, it will never discover R1 as an OSPF neighbor even though IP connectivity exists.
Verify:
! On R1
show ip ospf neighbor
Expected output (now including R2):
Neighbor ID Pri State Dead Time Address Interface
0.0.0.2 50 FULL/BDR 00:00:32 10.10.10.2 GigabitEthernet0/0
0.0.0.3 100 FULL/DR 00:00:35 10.10.20.2 GigabitEthernet0/1
0.0.0.4 1 FULL/DR 00:00:36 10.10.30.2 GigabitEthernet0/2
Verification Checklist
- show ip ospf neighbor on each router shows FULL adjacencies to expected neighbors.
- show ip ospf interface GigabitEthernet0/0 (and Gi0/1 where applicable) shows configured Priority and DR/BDR state as intended.
- show ip route contains OSPF-learned routes for remote 10.10.* networks.
Common Mistakes
| Symptom | Cause | Fix |
|---|---|---|
| No OSPF neighbor on a link despite IP ping working | OSPF not enabled on that interface (wrong/missing network statement) | Add correct network <subnet> <wildcard> area 10 under router ospf 1; clear ip ospf process |
| DR not as expected | Default priorities left unchanged on interfaces | Set interface ... ip ospf priority <value> and clear ip ospf process to re-elect |
| Router appears with unexpected Router ID | No router-id configured; router picked highest IP | Configure router-id 0.0.0.X to set consistent ID and restart OSPF if needed |
Warning:
clear ip ospf processwill briefly remove OSPF routes and adjacencies while the process restarts — run it during a maintenance window on production devices.
Challenge Task
Without step-by-step guidance: Create a topology variation where R2 has two links (10.10.10.2 and a new 10.10.50.2). Configure OSPF so that R2 advertises both links into area 10, make R1 the DR for 10.10.10 and make R2 the DR for 10.10.50. Then intentionally misconfigure one network statement and use show/debug commands to locate and fix the mistake. No solution shown — find and fix independently.
Final note: OSPF works correctly only when area, interfaces enabled for OSPF, and priorities are set intentionally. Thinking in terms of "who is advertising what, and on which interface" helps translate procedural config into predictable network behavior.