I know OSPF router-id is just name for identification.


Why OSPF router ID should be hardcoded ,is there any reason for that ?

  • 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 could provide and accept your own answer.
    – Ron Maupin
    Aug 8 '17 at 21:06

By default, the highest ip address in the router loopbacks is chosen as the router id. It's smarter to force the router to choose a router id that I want instead of letting it choose for me. OSPF router id is part of the DR / BDR election criteria, as well as the DBD exchange master selection criteria. Also consider that duplicate router ids are very bad; if you control the router id, the only person to blame for duplication is yourself.


So you know what it is. Otherwise, you have to figure out what is the highest loopback IP address. If you have lots of routers, that could be a lot of unnecessary work.

It doesn't matter much in a lab configuration, but if you have hundreds or thousands of routers, it becomes a big deal to keep track of them all.


Also you can use the ip ospf name-lookup command to perform a reverse DNS lookup on the router-id. If your DNS is set up correctly this can help you quickly identify the router.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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