Example: Configuring a Multiarea OSPF Network
This example shows how to configure a multiarea OSPF network. To reduce traffic and topology maintenance for the devices in an OSPF autonomous system (AS), you can group the OSPF-enabled routing devices into multiple areas.
Before you begin:
Configure the device interfaces. See the Interfaces Feature Guide for Security Devices.
Configure the router identifiers for the devices in your OSPF network. See Example: Configuring an OSPF Router Identifier.
Control OSPF designated router election. See Example: Controlling OSPF Designated Router Election
Configure a single-area OSPF network. See Example: Configuring a Single-Area OSPF Network.
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.
Each OSPF area consists of routing devices configured with the same area number. In Figure 1, Router B resides in the backbone area of the AS. The backbone area is always assigned area ID 0.0.0.0. (All area IDs must be unique within an AS.) All other networks or areas in the AS must be directly connected to the backbone area by a router that has interfaces in more than one area. In this example, these area border routers are A, C, D, and E. You create an additional area (area 2) and assign it unique area ID 0.0.0.2, and then add interface ge-0/0/0 to the OSPF area.
To reduce traffic and topology maintenance for the devices in an OSPF AS, you can group them into multiple areas as shown in Figure 1. In this example, you create the backbone area, create an additional area (area 2) and assign it unique area ID 0.0.0.2, and you configure Device B as the area border router, where interface ge-0/0/0 participates in OSPF area 0 and interface ge-0/0/2 participates in OSPF area 2.
CLI Quick Configuration
To quickly configure a multiarea OSPF network, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the  hierarchy level, and then enter commit from configuration mode.
To configure a multiarea OSPF network:
- Configure the backbone area.
For an OSPFv3 network, include the ospf3 statement at the [edit protocols] hierarchy level.user@A# set protocols ospf area 0.0.0.0 interface ge-0/0/0user@A# set protocols ospf area 0.0.0.0 interface ge-0/0/1user@C# set protocols ospf area 0.0.0.0 interface ge-0/0/0user@B# set protocols ospf area 0.0.0.0 interface ge-0/0/0
- Configure an additional area for your OSPF network.
For a multiarea OSPFv3 network, include the ospf3 statement at the [edit protocols] hierarchy level.user@host# set protocols ospf area 0.0.0.2 interface ge-0/0/0user@D# set protocols ospf area 0.0.0.2 interface ge-0/0/2user@E# set protocols ospf area 0.0.0.2 interface ge-0/0/2
- If you are done configuring the device, commit the configuration.user@host# commit
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.
Confirm that the configuration is working properly.
Verifying the Interfaces in the Area
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.
From operational mode, enter the show ospf interface command for OSPFv2, and enter the show ospf3 interface command for OSPFv3.