OSPF Router-Id Does Not Change When the Interface IP Address Changes

The venerable rules used to establish OSPF router ID on Cisco IOS are all over the Internet:

  • Take the highest IP address of all loopback interfaces configured on the router when the OSPF process is started.
  • If there is no loopback interface, take the highest IP address of an operating interface.

In the old days, when Cisco believed that the router ID had to match an interface address, this also implied that the router ID would have changed if the interface IP address changed (and we told the students that you have to use loopback interfaces to make your network stable, as the OSPF process would restart if the interface giving the router ID went down).

Most of these “wisdoms” are no longer true:

  • The OSPF router ID is a 32-bit value that must be unique (that’s all the OSPF RFC has ever asked for).
  • It just happens to be taken from an interface address when the OSPF process is started.
  • You can configure it to any value with the router-id A.B.C.D router configuration command.

The new behavior, while making your network more stable, can also bring unexpected side effects: if you don’t use the router-id command and misconfigure an interface IP address (resulting in duplicate router IDs), correcting the interface IP address will not fix the problem. You must also reset the OSPF process with the clear ip ospf pid process command.


  1. I happened to be messing with an OSPF lab today, so I decided to experiment per your post. However, I noticed that the router ID doesn't change even after 'clear ip ospf [process_id] process'.

    Neighbors still report the original ID, as does 'show ip ospf'.

    This was observed on a 3725 running 12.2(15)T14 and a 3560G running 12.2(25r)SE1, so the change may only apply in more recent code.
  2. I did test on 6500 with 12.2(18)SXF.
    If router id is derived from interface IP address, than change of interface ip address or interface shutdown and clear ip ospf process command does not change router id. If router id is derived from router-id command, than change of router-id command and clear ip ospf process will change router-id. Thank for hint!
  3. >:o :) :'( 8-) :* :-D =-O =-X :-P :-E :-$ :-P :-E *DONT_KNOW* =-X *DONT_KNOW* *DONT_KNOW* :-E =-O =-O
Add comment