Lab Objective
Observe a router's automatically selected OSPF Router ID, manually configure a specific Router ID instead, and verify the change requires the OSPF process to be cleared before taking effect.
Lab Purpose
By default, OSPF selects its Router ID from the highest active loopback address, or if none exists, the highest active physical interface address at process startup. Relying on this automatic selection can produce unpredictable Router IDs as interfaces are added or removed over time, making manual configuration a common best practice for stability and readability.
Lab Topology
R1 with interfaces:
GigabitEthernet0/0: 192.168.1.1/24
Loopback0: 172.16.1.1/32
OSPF process 1 already runningTask 1: Identify the Current Automatic Router ID
Determine what Router ID OSPF has automatically selected for R1.
Task 2: Manually Configure a Router ID
Set R1's OSPF Router ID explicitly to 1.1.1.1, a value with no relationship to any of its actual interface addresses.
Task 3: Verify the Configuration Does Not Yet Take Effect
Check the Router ID again immediately and confirm it has not changed, despite the new configuration being accepted.
Task 4: Clear the OSPF Process
Clear the OSPF process to force it to restart and apply the new Router ID.
Task 5: Verify the New Router ID Is Active
Confirm the manually configured Router ID is now in effect.
Solution and Verification
R1# show ip ospf | include Router ID
Routing Process "ospf 1" with ID 172.16.1.1
-- Automatically selected from the loopback
-- address, since a loopback is preferred
-- over a physical interface when presentR1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
Reload or use "clear ip ospf process" command
for this to take effectR1# show ip ospf | include Router ID
Routing Process "ospf 1" with ID 172.16.1.1
-- Unchanged -- the IOS warning shown above
-- was not just a formality; the new Router
-- ID genuinely has not taken effect yetR1# clear ip ospf process
Reset ALL OSPF processes? [no]: yesR1# show ip ospf | include Router ID
Routing Process "ospf 1" with ID 1.1.1.1
-- The manually configured Router ID is
-- now activeKey Takeaway
Changing the Router ID with the router-id command never takes effect immediately — it requires either a full reload or a clear ip ospf process to restart the OSPF process, which also temporarily tears down and rebuilds every neighbor adjacency on that router, a disruption worth planning for during a maintenance window rather than assuming the change applies instantly and harmlessly.