OSPF Router ID selection trivia

True or false: If you have an (enabled) loopback interface configured on the router, its IP address will always be used as the OSPF router ID.

Answer: False. Each OSPF process running on the router needs a unique Router ID. If you have a single loopback interface and two OSPF processes, the second OSPF process is forced to select another interface address as its router ID.

Here is a sample router printout:

Test#show running | inc ^interface|^ ip address
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
interface FastEthernet0/0
 ip address 10.1.0.1 255.255.255.0
Test#show ip ospf | inc Routing Process
 Routing Process "ospf 2" with ID 10.1.0.1
 Routing Process "ospf 1" with ID 10.0.0.1

8 comments:

  1. You also have a nice explanation here:

    http://blog.ioshints.info/2007/10/ospf-router-id-does-not-change-when.html


    -as

    ReplyDelete
  2. In case of single OSPF process when you configure Loopback after OSPF, OSPF will use IP from any "live" interface.

    ReplyDelete
  3. now i got ur point , thanks Ivan -:)

    ReplyDelete
  4. thanks ivan for great input.

    regards
    shivlu jain

    ReplyDelete
  5. selection of router-id for single ospf process:
    1) router-id command
    2) ip address of loopback interface (higher address in case of more that one loopback)
    3) ip address of interface wiht higher ip address

    ReplyDelete
  6. Does the router ID have to be an IP that's assigned to an interface? If we used 1.1.1.1 does there have to be an interface with that IP assigned to it?

    ReplyDelete
  7. No, the OSPF router-ID is a 32-bit quantity that has to be unique throughout the OSPF domain. Cisco has long tied it to an active interface, but you can configure it manually with the "router-id" configuration command.

    ReplyDelete
  8. how to hint sopf router properly plea hint aboute

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.