At the moment of OSPF process startup, the highest IP address on any active interface will be the Router ID (RID) of the router . If you have a loopback interface configured (logical interface), then that will override the interface IP address and become the RID of the router automatically.