I am a little confused on the process OSPF uses to select the Router ID. Is following correct for the selection of the router ID in OSPF?

  1. Manual configuration
  2. Highest IP address on a loopback interface
  3. Highest IP address on a non-loopback interface
  • 1
    That is correct, at least for Cisco routers.
    – Ron Trunk
    Apr 17, 2017 at 1:09
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Mar 30, 2020 at 1:07

2 Answers 2


Amazingly enough, for something so important to OSPF, the RFC doesn't define the Router ID selection process. A Router ID is simply a 32-bit number, and the implementation of it may vary from vendor to vendor. What you describe is how Cisco does it, but other vendors are free to do it any way they want. In fact, the example in RFC 2328, OSPF Version 2 is using the smallest IP address (see below), not the largest as Cisco does.

The Router ID is not an IPv4 address, and you can use a Router ID that is any 32-bit number, even if it looks like a bad IPv4 address.

Router ID

A 32-bit number that uniquely identifies this router in the AS. One possible implementation strategy would be to use the smallest IP interface address belonging to the router. If a router's OSPF Router ID is changed, the router's OSPF software should be restarted before the new Router ID takes effect. In this case the router should flush its self-originated LSAs from the routing domain (see Section 14.1) before restarting, or they will persist for up to MaxAge minutes.


OSPF Router-ID selection happens in the below order.

  1. Manually configure a 32-bit Router-ID.
  2. Highest IP of the loop back interface, if 1 is not configured.
  3. Highest IP of any active interface,if 1 & 2 has not configured.
  • 1
    That is only for Cisco devices. The question is not specific to Cisco, so the answer could actually be something else for a different vendor.
    – Ron Maupin
    Apr 17, 2017 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.