OSPF Router ID Conflict Causing Instability
Presenting Symptom
OSPF neighbors are flapping between routers, causing intermittent routing table changes and network instability.
Network Context
A small enterprise campus network with two Cisco 4321 routers (R1 and R2) running IOS XE 16.9, connected via a Gigabit Ethernet link. OSPF is configured in area 0 with default settings. The network has about 50 hosts and uses a single OSPF area.
Diagnostic Steps
Check OSPF neighbor state
show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface 10.0.0.1 1 FULL/DR 00:00:35 10.0.0.2 GigabitEthernet0/0 10.0.0.1 1 FULL/DR 00:00:35 10.0.0.2 GigabitEthernet0/0
If the same neighbor ID appears multiple times or the state flips between FULL and INIT/EXSTART, it indicates a router ID conflict. A stable neighbor should show a single entry with FULL state.
Verify router IDs on each router
show ip ospf | include Router IDR1: Routing Process "ospf 1" with ID 10.0.0.1 R2: Routing Process "ospf 1" with ID 10.0.0.1
If both routers show the same router ID, that confirms the conflict. Each router must have a unique router ID.
Check OSPF database for duplicate LSAs
show ip ospf database routerLS age: 10 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 10.0.0.1 Advertising Router: 10.0.0.1 ... LS age: 15 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 10.0.0.1 Advertising Router: 10.0.0.1
Multiple LSAs with the same Link State ID and Advertising Router indicate duplicate router IDs. This causes OSPF to process conflicting information, leading to flapping.
Examine OSPF events with debug
debug ip ospf eventsOSPF: Rcv pkt from 10.0.0.2, GigabitEthernet0/0, area 0.0.0.0, packet type: 1 OSPF: Send pkt to 10.0.0.2, GigabitEthernet0/0, area 0.0.0.0 OSPF: Neighbor change event: neighbor 10.0.0.1 state changed from FULL to EXSTART OSPF: Neighbor change event: neighbor 10.0.0.1 state changed from EXSTART to INIT
Frequent neighbor state changes (e.g., FULL to EXSTART to INIT) indicate instability. The debug output may show the same router ID in packets from different sources, confirming the conflict.
Root Cause
Both routers have the same OSPF router ID (10.0.0.1) because the router ID was manually configured identically on both devices. OSPF requires each router to have a unique router ID; a conflict causes neighbor flapping and routing instability.
Resolution
Verification
After the fix, run: show ip ospf neighbor Expected output: R1# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 10.0.0.2 1 FULL/DR 00:00:35 10.0.0.2 GigabitEthernet0/0 R2# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 10.0.0.1 1 FULL/DR 00:00:35 10.0.0.1 GigabitEthernet0/0 Both routers show unique neighbor IDs and stable FULL state.
Prevention
["Always configure unique router IDs manually or rely on loopback interfaces with unique IP addresses.","Use a consistent naming convention for router IDs (e.g., use the router's loopback IP).","Before adding a new router to an OSPF domain, verify that its router ID does not conflict with existing routers."]
CCNA Exam Relevance
On the CCNA 200-301 exam, this scenario may appear as a troubleshooting question where you must identify the cause of OSPF neighbor flapping. The exam tests your ability to use show commands (show ip ospf neighbor, show ip ospf) to diagnose router ID conflicts. Key fact: OSPF router ID must be unique; it is chosen from the highest loopback IP, then highest physical IP, or manually configured.
Exam Tips
Memorize the OSPF router ID selection order: manual > loopback > highest active interface IP.
In troubleshooting questions, if neighbors are flapping, always check for duplicate router IDs first.
Know that changing the router ID requires clearing the OSPF process (clear ip ospf process) to take effect.
Commands Used in This Scenario
clear ip ospf process
Resets the OSPF process on the router, forcing it to re-establish all neighbor adjacencies and re-learn routes.
debug ip ospf events
Enables real-time debugging of OSPF event messages to troubleshoot neighbor adjacency issues, route propagation problems, or OSPF state changes.
show ip ospf
Displays general information about OSPF routing process, including router ID, areas, and LSDB statistics, used to verify OSPF configuration and operational status.
show ip ospf neighbor
Displays OSPF neighbor information to verify adjacency formation and troubleshoot OSPF neighbor relationships.
Test Your CCNA Knowledge
Practice with scenario-based questions to prepare for the CCNA 200-301 exam.
Practice CCNA Questions