Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

router-id

Syntax

Hierarchy Level

Description

Specify the routing device’s IP address.

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. If you do not configure a router identifier, the IP address of the first interface to come online is used. This is usually the loopback interface. Otherwise, the first hardware interface with an IP address is used.

Note:

We strongly recommend that you configure the router identifier under the [edit routing-options] hierarchy level to avoid unpredictable behavior if the interface address on a loopback interface changes.

You must configure a router-id in order for BGP and OSPF to function in a routing instance. Use the show route instance detail command to display the router-id value for a routing instance. If the router-id is 0.0.0.0, then the routing instance has no router-id.

For more information about the router identifier in OSPF, see Example: Configuring an OSPF Router Identifier.

Note:

If you run OSPF3 or IPv6 based BGP peering in a routing instance, you must configure a router identifier (router-id) in the routing instance itself. In other words, the router-id used for the main routing instance is not inherited by other routing instances. Even if you run only OSPF3 or IPv6 BGP peering in a routing instance, a 32-bit router-id must be configured in the instance. This is because IPv6 routing protocols use the router-id for handshaking. The router ID must be configured as a 4 octet (32 bit) unsigned non-zero integer value.

It's often convenient to use an IPv4 address as the router ID. However, a valid IPv4 address is not required. The RID does not have to be a routable IPv4 address. You can configure any 32-bit value that is unique within the routing domain. If you do not configure the router-id in an IPv6 OSPF or BGP routing instance the IPv6 protocols will use an invalid value for the router ID (0.0.0.0) and the adjacency and connections will fail

When you configure a router ID with an IP address that differs from the BGP local address for EVPN routing instances, you must also configure a policy that exports the local IP address for BGP routes. This ensures that EVPN traffic will be properly routed. For more information on exporting BGP routes, see Basic BGP Routing Policies.

Options

address—IP address of the routing device.

  • Default: Address of the first interface encountered by Junos OS

Starting in Junos OS Release 20.4R1, you can establish a BGP connection with the BGP identifier that is a 4-octet, unsigned, and non-zero integer and it needs to be unique only within the Autonomous System (AS) per RFC6286, Autonomous-System-Wide Unique BGP Identifier for BGP-4

Required Privilege Level

routing—To view this statement in the configuration.

routing-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.