Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

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.

Requirements

Before you begin:

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.

Each OSPF area consists of routing devices configured with the same area number. The backbone area is always assigned area ID 0.0.0.0. (All area identifiers (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 Figure 1, Devices A and C are in the backbone area (area 0), and Devices D and E are in area 2. Device B has a special role. This is the area border router that connects area 0 and area 2. The area border router maintains a separate topological database for each area to which it is connected.

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.

Figure 1: Typical Multiarea OSPF Network Topology

Typical Multiarea OSPF Network
Topology

Configuration

CLI Quick Configuration

To quickly configure a multiarea OSPF network, copy the following commands and paste them into the CLI. You repeat this configuration for all interfaces that are part of the OSPF area.

Device A

[edit]set protocols ospf area 0.0.0.0 interface ge-0/0/0set protocols ospf area 0.0.0.0 interface ge-0/0/1

Device C

[edit]set protocols ospf area 0.0.0.0 interface ge-0/0/0

Device B

[edit] set protocols ospf area 0.0.0.0 interface ge-0/0/0set protocols ospf area 0.0.0.2 interface ge-0/0/2

Device D

[edit] set protocols ospf area 0.0.0.2 interface ge-0/0/0set protocols ospf area 0.0.0.2 interface ge-0/0/2

Device E

[edit] set protocols ospf area 0.0.0.2 interface ge-0/0/2

Step-by-Step Procedure

To configure a multiarea OSPF network:

  1. Configure the backbone area.

    Note: For an OSPFv3 network, include the ospf3 statement at the [edit protocols] hierarchy level.

    [edit]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/1
    [edit]user@C# set protocols ospf area 0.0.0.0 interface ge-0/0/0
    [edit]user@B# set protocols ospf area 0.0.0.0 interface ge-0/0/0
  2. Configure an additional area for your OSPF network.
    [edit]user@B# set protocols ospf area 0.0.0.2 interface ge-0/0/2
    [edit]user@D# 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/2
    [edit]user@E# set protocols ospf area 0.0.0.2 interface ge-0/0/2
  3. 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.

user@A# show protocols ospf
area 0.0.0.0 { interface ge-0/0/0.0;interface ge-0/0/1.0;}
user@C# show protocols ospf
area 0.0.0.0 { interface ge-0/0/0.0;}
user@B# show protocols ospf
area 0.0.0.0 { interface ge-0/0/0.0;}
area 0.0.0.2 { interface ge-0/0/2.0;}
user@D# show protocols ospf
area 0.0.0.2 { interface ge-0/0/0.0;interface ge-0/0/2.0;}
user@E# show protocols ospf
area 0.0.0.2 { interface ge-0/0/2.0;}

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.

Published: 2014-07-23