Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- Understanding OSPF Areas and Backbone Areas
Example: Configuring a Single-Area OSPF Network
This example shows how to configure a single-area OSPF network.
Requirements
Before you begin:
- Configure the device interfaces. See the Junos OS Network Interfaces Library for Routing Devices 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
To activate OSPF on a network, you must enable the OSPF protocol on all interfaces within the network on which OSPF traffic is to travel. To enable OSPF, you must configure one or more interfaces on the device within an OSPF area. Once the interfaces are configured, OSPF LSAs are transmitted on all OSPF-enabled interfaces, and the network topology is shared throughout the network.
In an autonomous system (AS), the backbone area is always assigned area ID 0.0.0.0 (within a simple, single-area network, this is also the ID of the area). Area IDs are unique numeric identifiers, in dotted decimal notation. Area IDs need only be unique within an AS. All other networks or areas in the AS must be directly connected to the backbone area by area border routers that have interfaces in more than one area. You must also create a backbone area if your network consists of multiple areas. In this example, you create the backbone area and add interfaces, such as ge-0/0/0, as needed to the OSPF area.
To use OSPF on the device, you must configure at least one OSPF area, such as the one shown in Figure 1.
Figure 1: Typical Single-Area OSPF Network Topology

Configuration
CLI Quick Configuration
To quickly configure a single-area OSPF network, copy the following command and paste it into the CLI. You repeat this configuration for all interfaces that are part of the OSPF area.
Step-by-Step Procedure
To configure a single-area OSPF network:
- Configure the single-area OSPF network by specifying the
area ID and associated interface.
Note: For a single-area OSPFv3 network, include the ospf3 statement at the [edit protocols] hierarchy level.
[edit]user@host# set protocols ospf area 0.0.0.0 interface ge-0/0/0 - 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 Interfaces in the Area
Purpose
Verify that the interface for OSPF or OSPFv3 has been configured for the appropriate area. Confirm that the Area field displays the value that you configured.
Action
From operational mode, enter the show ospf interface command for OSPFv2, and enter the show ospf3 interface command for OSPFv3.
Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- Understanding OSPF Areas and Backbone Areas
Published: 2014-07-23
Related Documentation
- ACX, J, M, MX, SRX, T Series
- OSPF Configuration Overview
- Understanding OSPF Areas and Backbone Areas