Description

The article explains the BGP router ID] selection hierarchy

Symptoms

The router identifier is used by BGP and OSPF to identify the routing device from which a packet originated. The router identifier usually is the IP address of the local routing device.

Solution

The router identifier is used by BGP and OSPF to identify the routing device from which a packet originated. The router identifier usually is the IP address of the local routing device.


The router ID is chosen based on a specific hierarchy. The router uses the manually configured Router ID from the router-id statement under [edit routing-options] if available. Otherwise, it selects the router ID from the IP addresses assigned to its interfaces.


For the inet address family, the router ID is chosen in the following order:

  1. User configured router ID (if available).
  2. Instance’s first loopback address (or its primary address, if configured).
  3. Non-point-to-point (non-P2P) local interface address is preferred over a local point-to-point (P2P) interface address.
  4. From the selected addresses in step 3, pick the numerically lowest IP address as the router ID.

Note: For the inet6 address family, the router ID selection algorithm is similar, but link-local addresses are skipped.


Please find the below Reference document:

https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/router-id-edit-routing-options.html

 

Modification History

2025-09-05 : Article Created

Related Information

https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/router-id-edit-routing-options.html