Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.4.4. Router ID

💡 First Principle: Every OSPF router needs a unique name within the OSPF domain—that's the Router ID (RID). Think of it like a Social Security number for routers: no two can share the same one, and OSPF uses it to track who originated which LSA.

Selection order (memorize this—it's heavily tested):
  1. Manually configured router-id command (always preferred)
  2. Highest loopback interface IP address (if no manual RID)
  3. Highest active physical interface IP address (last resort)

Why manually configure it? If the interface whose IP was chosen as the RID goes down, the RID doesn't change automatically—but confusion arises when you add a higher IP later. Manual configuration eliminates surprises.

The RID is set at process startup. Changing it requires either clear ip ospf process (resets all adjacencies!) or reloading the router. This is why best practice is to set the RID explicitly before adding any network statements.

The RID also determines DR/BDR elections as a tiebreaker—when two routers have the same OSPF priority, the higher RID wins the election.

Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Verification:
Router# show ip ospf | include Router ID
 Routing Process "ospf 1" with ID 1.1.1.1

⚠️ Exam Trap: The RID doesn't have to be a reachable IP address—it's just a 32-bit identifier in dotted decimal format. Also, changing the router-id doesn't take effect until the OSPF process restarts.