First configure the IP address 192.168.0.1 for vlan1 interface
Then configure OSPF, at this time OSPF elects the router-id as 192.168.0.1
Next configure two IP addresses starting with 198, then reset OSPF process
Found that the router-id remains 192.168.0.1 and did not update to the larger IP address as per the configuration guide principle
The principles for obtaining the OSPF router-ID are as follows:
1. Manually specify the Router ID
Users can specify the Router ID when creating an OSPF process. During configuration, it must be ensured that the IDs of any two routers in the autonomous system (AS) are different. A common practice is to set the router's ID to match the IP address of one of its interfaces.
2. Automatically obtain the Router ID
If you select automatic assignment of the Router ID when creating an OSPF process, the OSPF process will automatically obtain the Router ID according to the following rules:
When the OSPF process starts, it will select the primary IPv4 address of the first interface running this process as the Router ID.
When the device restarts, the OSPF process will select the primary IPv4 address of the first interface running this process as the Router ID.
When the OSPF process restarts, it will reacquire the Router ID from the primary IPv4 addresses of all interfaces running this process. The specific rules are as follows:
If there is a Loopback interface configured with an IP address, select the largest one among the Loopback interface addresses as the Router ID.
Otherwise, select the largest IP address from other interfaces as the Router ID (regardless of the interface up/down status).
3. Use the global Router ID
If no Router ID is specified when creating an OSPF process, the global Router ID is used by default. Users are advised to manually specify a Router ID or select to automatically obtain a Router ID when creating an OSPF process.
-------------------------------------------
The second type refers to the OSPF router-id auto-select command. Since this command is not configured here, the third global router-id is used. The principle for obtaining the global router-id is as follows.
Therefore, the OSPF router-id selection logic in the environment is: not manually specified or automatically obtained, so the global router-id is acquired. Since no global router-id is configured, the largest IP address is automatically selected as the global one. Restarting OSPF does not affect the global router-id, and the previously configured 192.168.0.1 will still be obtained again.
Document link: https://www.h3c.com/cn/d_202504/2389788_30005_0.htm#_Toc194332401
-----------------------------------------------
(2) (Optional) Configure the global router ID.
router id router-id
the default no global router ID is configured.
When no global router ID is configured select according to the following rules:
If there is a Loopback interface with an IP address configured select the largest one among the Loopback interface addresses as the router ID.
If no Loopback interface is configured with an IP address, select the largest IP address from other interfaces as the Router ID (regardless of the interface up/down state).
It is recommended to manually configure the router-id