Use it when planning router IDs, when a configured ID does not take effect, or when a neighbour will not form or routes flap because two routers share an ID.
OSPF Router ID Selection & Duplicate RID Reference
The OSPF router ID is a 32-bit number that names a router. It is taken from the router-id command, otherwise the highest loopback address, otherwise the highest interface address — and it must be unique.
1. show ip ospf | include ID — is it the configured value?
2. Not → the process has not been restarted since router-id was entered.
3. Log shows a duplicate → find the other router with that ID.
4. Routes flapping, SPF running constantly → look for the LSA whose sequence number keeps climbing.
5. Change IDs in a maintenance window; it drops all neighbours.
router ID configured explicitly → process (re)started with it → unique among neighbours → unique in the area → LSAs stable, sequence numbers rising only at refresh
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip ospf | include IDVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
show ip ospf | include ID
show ip protocols | include Router ID
show ip ospf neighbor
show ip ospf database router | include Advertising|Seq
show logging | include DUP_RTRID|router-id
The first two show the ID in use. The neighbour table lists the neighbours' IDs. The database output lists each originator with its sequence number; one that grows from one look to the next points at a duplicate. The log contains duplicate-ID messages naming the area or the interface.
Known-good: the ID in use equals the configured one, each ID occurs once in the domain, and sequence numbers rise only at the half-hourly refresh.
Step 2 Failure isolation workflow Narrow the fault
- A neighbour does not form and the log reports a duplicate router ID. The two neighbours have the same ID.
- Routes in the area flap and SPF runs continuously. Two non-adjacent routers share an ID; find the LSA with the racing sequence number.
router-idis configured but the old ID is still shown. The process has not been restarted.- The ID changed after a reload. It was selected automatically and a different interface was highest; configure it.
- A virtual link stopped working. It refers to a router ID that has since changed.
- Two processes on one router. Each needs its own ID.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The ID is chosen when the process starts and kept; a new router-id applies only after clear ip ospf process or a reload. Duplicates between neighbours block the adjacency; duplicates elsewhere in the area make routes flap. Configure it explicitly everywhere.
show ip ospf | include ID— the ID in use.show ip ospf neighbor— the neighbours' IDs.show ip ospf database router | include Advertising|Seq— a sequence number that races upward.show logging | include DUP_RTRID— duplicate-ID messages.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
The OSPF router ID is a 32-bit number, written like an IPv4 address, that names a router within OSPF. It has to be unique. This topic covers how a router picks its ID, when a change takes effect, and what happens when two routers use the same one.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
The ID appears in every neighbour table and every LSA. If it is chosen automatically it can change after a reload, which makes the network harder to read and breaks anything that refers to it, such as virtual links. If it is duplicated — usually by copying a configuration — the symptoms range from a missing neighbour to routes that come and go across the whole area.
ReferenceHow it works1 section · depth on demand
How it works
Selection, in order:
1. The value configured with router-id <a.b.c.d> under the OSPF process.
2. Otherwise the highest IP address on a loopback interface.
3. Otherwise the highest IP address on any other interface that is up.
The ID does not need to be reachable, or even to be an address on the router; it is a name.
It is sticky. The choice is made when the OSPF process starts and is kept. Adding a loopback later, or an interface going down, does not change it. A newly configured router-id takes effect only when the process restarts — clear ip ospf process or a reload — and the router says so when the command is entered. Restarting the process drops all neighbours, so it belongs in a maintenance window.
Duplicates between neighbours. A router that receives a Hello carrying its own ID ignores it. The two never become neighbours, and the log reports a duplicate router ID on that interface.
Duplicates elsewhere in the area. The two routers are not neighbours, so nothing stops them. Each originates a Router LSA under the same identity. Every time one of them sees the other's version it issues a newer one of its own, and the two keep replacing each other throughout the area. Routes behind both routers flap, SPF runs constantly, and the sequence number of that LSA climbs rapidly.
Setting the ID explicitly on every router — commonly to the address of Loopback0 — avoids both problems.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Router ID selection and what duplicate router IDs do
The Catalyst 9300 OSPF guide states that OSPF uses the highest interface IP address as router ID, that a loopback address takes precedence, and that a configured router-id overrides both. RFC 2328 uses the router ID as the Link State ID and Advertising Router of the router-LSA, so the router ID is the key for that router's LSAs.
Selection (IOS XE)
| Order | Source |
|---|---|
| 1 | router-id in the OSPF process |
| 2 | Highest IPv4 address on an up loopback |
| 3 | Highest IPv4 address on an up non-loopback interface |
It is selected when the process starts. A change only takes effect after clear ip ospf process or a reload.
Duplicate router IDs
| Scope | Symptom |
|---|---|
| Two direct neighbours | No adjacency; %OSPF-4-DUP_RTRID_NBR |
| Two routers in the same area, not neighbours | Both keep re-originating their router-LSA (each sees "its own" LSA with different content); constant SPF runs, flapping routes; %OSPF-4-DUP_RTRID_AREA on some releases |
| Different areas | Inter-area routes and ASBR reachability can break |
C9300# show logging | include DUP_RTRID
%OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 10.0.0.11 from 10.255.0.2 on interface TenGigabitEthernet1/1/1
C9300# show ip ospf | include Routing Process|SPF algorithm executed
Routing Process "ospf 1" with ID 10.0.0.11
SPF algorithm executed 14832 times
C9300# show ip ospf database router 10.0.0.11 | include Seq|Advertising
A rapidly rising SPF count and a router-LSA sequence number that climbs every few seconds are typical of a duplicate router ID in an area.
Prevention
- Configure
router-idexplicitly, equal to Loopback0. - Track router IDs in IPAM alongside loopback addresses.
- Before connecting a cloned switch or a lab device to production, change its router ID.
- Check
show ip ospf neighboron both ends after any new device joins.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → OSPF Router ID Selection & Duplicate RID Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc2328.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.