< Home

router id

Function

The router id command sets the global router ID.

The undo router id command deletes the configured global router ID.

By default, the global router ID is 0.0.0.0 when no IPv4 interface address is configured.

Format

router id router-id

undo router id

Parameters

Parameter Description Value

router-id

Sets a router ID in the IPv4 address format.

The value is in dotted decimal notation.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A router ID is a 32-bit integer used to uniquely identify a device that uses a specific dynamic routing protocol for route exchange. A router ID uses the same format as an IP address. Router IDs are classified into global router IDs of devices and router IDs of dynamic routing protocols.

The rules for selecting a global router ID are as follows:

  1. If you set the global router ID using the router id command, the configured router ID is used.

  2. If no global router ID is set, the router selects a router ID based on IP addresses of current interfaces:
    • If there are loopback interfaces that have IP addresses configured, the device selects the largest IP address among loopback interface addresses as the global router ID.
    • If no loopback interface is configured or loopback interfaces do not have IP addresses configured, the device selects the largest IP address among interface addresses as the global router ID without considering the Up/Down state of interfaces.
      The global router ID is reselected only when the interface address that is selected as the global router ID is deleted or changed. The global router ID is not reselected in any of the following situations:
      • The interface is Down.
      • A loopback interface is configured when the IP address of a non-loopback interface is selected as the router ID.
      • A larger interface address is configured later.

      You can run the display router id command to view the global router ID.

  3. Each VPN instance selects the router ID from the IP addresses of the interfaces in the VPN instance based on rules 1 and 2.

After the global router ID is changed, manually run the reset command for each routing protocol to make the new global router ID take effect.

Precautions

When a device is being initialized and there is no interface address on the device, the first configured IP address on the device, which may be a loopback interface address or another interface address, will become the global router ID of the device. This global router ID remains unchanged even if there is a larger interface IP address on the device.

The IP address of the interface whose configuration is restored the first is used as the global router ID after the restart.

To enhance network reliability, configure the address of a loopback interface as the global router ID.

Example

# Set the global router ID to 10.10.10.1.

<HUAWEI> system-view
[HUAWEI] router id 10.10.10.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >