Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- ACX, J, M, MX, PTX, SRX, T Series, QFabric System, QFX Series standalone switches
- OSPF Designated Router Overview
- Example: Controlling OSPF Designated Router Election
Example: Configuring an OSPF Router Identifier
This example shows how to configure an OSPF router identifier.
Requirements
Before you begin:
- Identify the interfaces on the routing device that will participate in OSPF. You must enable OSPF on all interfaces within the network on which OSPF traffic is to travel.
- Configure the device interfaces. See the Junos OS Network Interfaces Library for Routing Devices or the Junos OS Interfaces Configuration Guide for Security Devices.
Overview
The router identifier is used by OSPF to identify the routing device from which a packet originated. Junos OS selects a router identifier according to the following set of rules:
- By default, Junos OS selects the lowest configured physical IP address of an interface as the router identifier.
- If a loopback interface is configured, the IP address of the loopback interface becomes the router identifier.
- If multiple loopback interfaces are configured, the lowest loopback address becomes the router identifier.
- If a router identifier is explicitly configured using the router-id address statement under the [edit routing-options] hierarchy level, the above three rules are ignored.
![]() | Note: If the router identifier is modified in a network, the link-state advertisements (LSAs) advertised by the previous router identifier are retained in the OSPF database until the LSA retransmit interval has timed out. |
If the router identifier is not configured explicitly and an interface IP address is used as the router identifier, the established OSPF adjacency flaps when the interface goes down, or when it is brought back into the network. When the interface is brought back into the network, or a new interface is introduced into the network, the router identifier is selected again based on the rules stated above. Hence, it is strongly recommended that you explicitly configure the router identifier under the [edit routing-options] hierarchy level to avoid unpredictable behavior if the interface address on a loopback interface changes.
![]() | Note: The router identifier behavior described here holds good even when configured under [edit routing-instances routing-instance-name routing-options] and [edit logical-systems logical-system-name routing-instances routing-instance-name routing-options] hierarchy levels. |
In this example, you configure the OSPF router identifier by setting its router ID value to the IP address of the device, which is 177.162.4.24.
Configuration
CLI Quick Configuration
To quickly configure an OSPF router identifier, copy the following command and paste it into the CLI.
Step-by-Step Procedure
To configure an OSPF router identifier:
- Configure the OSPF router identifier by entering the [router-id] configuration value.[edit]user@host# set routing-options router-id 177.162.4.24
- If you are done configuring the device, commit the configuration.[edit]user@host# commit
Results
Confirm your configuration by entering the show routing-options router-id command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Verification
After you configure the router ID and activate OSPF on the routing device, the router ID is referenced by multiple OSPF operational mode commands that you can use to monitor and troubleshoot the OSPF protocol. The router ID fields are clearly marked in the output.
Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- ACX, J, M, MX, PTX, SRX, T Series, QFabric System, QFX Series standalone switches
- OSPF Designated Router Overview
- Example: Controlling OSPF Designated Router Election
Published: 2014-07-23
Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- ACX, J, M, MX, PTX, SRX, T Series, QFabric System, QFX Series standalone switches
- OSPF Designated Router Overview
- Example: Controlling OSPF Designated Router Election