OSPF's router ID is chosen based on the following criteria:
- Manually configured Router ID
- The highest IPv4 address on a loopback interface
- The highest IPv4 address on an active (up/up) interface
The router ID is elected when the ospf process starts. Once elected, a manual intervention in the OSPF process is necessary to reflect the change of the router ID. A text book says you need to issue "# clear ip ospf process" after changing the router ID, but in some cases, the command is not sufficient.
When explicitly configured with "(config-router)# router-id ROUTER_ID", "# clear ip ospf process" will work for you.
When implicitly configured with "a loopback interface" or "an active interface", you need to "#reload" the router to make the change effective.