OSPF router ID

Each OSPF router must be assigned a router ID in order to operate within an OSPF routing domain. The router ID is used to provide a unique identity to the OSPF router. An OSPF router obtains its router ID in one of the following ways:

  • It can be manually configured using the router-id command in OSPF configuration mode. If it is not configured then...
  • The router ID is defined as the highest IPv4 address on a loopback interface on the OSPF router. If there is no loopback interface, then...
  • the router ID is defined as the highest IPv4 address on a physical interface on the OSPF router.

Note:

  • It is best practice to either manually configure the router ID or use a loopback address. If an IP address on a physical interface is used, and that interface goes down, the router ID changes which will result in an unstable OSPF topology. Manually configured router IDs and loopbacks are less likely to fail.
  • OSPFv3 used within an exclusively IPv6 environment must still use an IPv4 address as the router ID. Take a look at OSPF router ID in an IPv6 environment for more details.

https://networklessons.com/ospf/basic-ospf-configuration