Related Documentation
- ACX, M, MX, QFX, T Series
- OSPF Areas and Router Functionality Overview
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
Examples: Configuring OSPF Designated Routers
OSPF Designated Router Overview
Large LANs that have many routing devices and therefore many OSPF adjacencies can produce heavy control-packet traffic as link-state advertisements (LSAs) are flooded across the network. To alleviate the potential traffic problem, OSPF uses designated routers on all multiaccess networks (broadcast and nonbroadcast multiaccess [NBMA] networks types). Rather than broadcasting LSAs to all their OSPF neighbors, the routing devices send their LSAs to the designated router. Each multiaccess network has a designated router, which performs two main functions:
- Originate network link advertisements on behalf of the network.
- Establish adjacencies with all routing devices on the network, thus participating in the synchronizing of the link-state databases.
In LANs, the election of the designated router takes place when the OSPF network is initially established. When the first OSPF links are active, the routing device with the highest router identifier (defined by the router-id configuration value, which is typically the IP address of the routing device, or the loopback address) is elected the designated router. The routing device with the second highest router identifier is elected the backup designated router. If the designated router fails or loses connectivity, the backup designated router assumes its role and a new backup designated router election takes place between all the routers in the OSPF network.
OSPF uses the router identifier for two main purposes: to elect a designated router, unless you manually specify a priority value, and to identify the routing device from which a packet is originated. At designated router election, the router priorities are evaluated first, and the routing device with the highest priority is elected designated router. If router priorities tie, the routing device with the highest router identifier, which is typically the routing device’s IP address, is chosen as the designated router. 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.
At least one routing device on each logical IP network or subnet must be eligible to be the designated router for OSPFv2. At least one routing device on each logical link must be eligible to be the designated router for OSPFv3.
By default, routing devices have a priority of 128. A priority of 0 marks the routing device as ineligible to become the designated router. A priority of 1 means the routing device has the least chance of becoming a designated router. A priority of 255 means the routing device is always the designated router.
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 Router Interfaces 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.
Example: Controlling OSPF Designated Router Election
This example shows how to control OSPF designated router election.
Requirements
Before you begin:
- Configure the device interfaces. See the Router Interfaces or the Junos OS Interfaces Configuration Guide for Security Devices.
- Configure the router identifiers for the devices in your OSPF network. See Example: Configuring an OSPF Router Identifier.
Overview
This example shows how to control OSPF designated router election. Within the example, you set the OSPF interface to ge-/0/0/1 and the device priority to 200. The higher the priority value, the greater likelihood the routing device will become the designated router.
By default, routing devices have a priority of 128. A priority of 0 marks the routing device as ineligible to become the designated router. A priority of 1 means the routing device has the least chance of becoming a designated router.
Configuration
CLI Quick Configuration
To quickly configure an OSPF designated router election, copy the following command and paste it into the CLI.
Step-by-Step Procedure
To control OSPF designated router election:
- Configure an OSPF interface and specify the device priority.
Note: To specify an OSPFv3 interface, include the ospf3 statement at the [edit protocols] hierarchy level.
[edit]user@host# set protocols ospf area 0.0.0.3 interface ge-0/0/1 priority 200 - If you are done configuring the device, commit the configuration.[edit]user@host# commit
Results
Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
To confirm your OSPFv3 configuration, enter the show protocols ospf3 command.
Verification
Confirm that the configuration is working properly.
Verifying the Designated Router Election
Purpose
Based on the priority you configured for a specific OSPF interface, you can confirm the address of the area’s designated router. The DR ID, DR, or DR-ID field displays the address of the area’s designated router. The BDR ID, BDR, or BDR-ID field displays the address of the backup designated router.
Action
From operational mode, enter the show ospf interface and the show ospf neighbor commands for OSPFv2, and enter the show ospf3 interface and the show ospf3 neighbor commands for OSPFv3.
Related Documentation
- ACX, M, MX, QFX, T Series
- OSPF Areas and Router Functionality Overview
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
Published: 2013-07-09
Related Documentation
- ACX, M, MX, QFX, T Series
- OSPF Areas and Router Functionality Overview
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview