Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring OSPF Multiarea Adjacency

    Multiarea Adjacency for OSPF

    By default, a single interface can belong to only one OSPF area. However, in some situations, you might want to configure an interface to belong to more than one area. Doing so allows the corresponding link to be considered an intra-area link in multiple areas and to be preferred over other higher-cost intra-area paths. For example, you can configure an interface to belong to multiple areas with a high-speed backbone link between two area border routers (ABRs) so you can create multiarea adjacencies that belong to different areas.

    In Junos OS Release 9.2 and later, you can configure a logical interface to belong to more than one OSPFv2 area. Support for OSPFv3 was introduced in Junos OS Release 9.4. As defined in RFC 5185, OSPF Multi-Area Adjacency, the ABRs establish multiple adjacencies belonging to different areas over the same logical interface. Each multiarea adjacency is announced as a point-to-point unnumbered link in the configured area by the routers connected to the link. For each area, one of the logical interfaces is treated as primary, and the remaining interfaces that are configured for the area are designated as secondary.

    Any logical interface not configured as a secondary interface for an area is treated as the primary interface for that area. A logical interface can be configured as primary interface only for one area. For any other area for which you configure the interface, you must configure it as a secondary interface.

    Example: Configuring Multiarea Adjacency for OSPF

    This example shows how to configure multiarea adjacency for OSPF.

    Requirements

    Before you begin, plan your multiarea OSPF network. See Example: Configuring a Multiarea OSPF Network.

    Overview

    By default, a single interface can belong to only one OSPF area. You can configure a single interface to belong in multiple OSPF areas. Doing so allows the corresponding link to be considered an intra-area link in multiple areas and to be preferred over other higher-cost intra-area paths. When configuring a secondary interface, consider the following:

    • For OSPFv2, you cannot configure point-to-multipoint and nonbroadcast multiaccess (NBMA) network interfaces as a secondary interface because secondary interfaces are treated as a point-to-point unnumbered link.
    • Secondary interfaces are supported for LAN interfaces (the primary interface can be a LAN interface, but any secondary interfaces are treated as point-to-point unnumbered links over the LAN). In this scenario, you must ensure that there are only two routing devices on the LAN or that there are only two routing devices on the LAN that have secondary interfaces configured for a specific OSPF area.
    • Since the purpose of a secondary interface is to advertise a topological path through an OSPF area, you cannot configure a secondary interface or a primary interface with one or more secondary interfaces to be passive. Passive interfaces advertise their address, but do not run the OSPF protocol (adjacencies are not formed and hello packets are not generated).
    • Any logical interface not configured as a secondary interface for an area is treated as a primary interface for that area. A logical interface can be configured as the primary interface only for one area. For any other area for which you configure the interface, you must configure it as a secondary interface.
    • You cannot configure the secondary statement with the interface all statement.
    • You cannot configure a secondary interface by its IP address.

    In this example, you configure an interface to be in two areas, creating a multiarea adjacency with a link between two ABRs: ABR R1 and ABR R2. On each ABR, area 0.0.0.1 contains the primary interface and is the primary link between the ABRs, and area 0.0.0.2 contains the secondary logical interface, which you configure by including the secondary statement. You configure interface so-0/0/0 on ABR R1 and interface so-1/0/0 on ABR R2.

    Configuration

    CLI Quick Configuration

    To quickly configure a secondary logical interface for an OSPF area, 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 [edit] hierarchy level, and then enter commit from configuration mode.

    Configuration on ABR R1:

    [edit] set interfaces so-0/0/0 unit 0 family inet address 192.0.2.45/24set routing-options router-id 10.255.0.1set protocols ospf area 0.0.0.1 interface so-0/0/0set protocols ospf area 0.0.0.2 interface so-0/0/0 secondary

    Configuration on ABR R2:

    [edit] set interfaces so-1/0/0 unit 0 family inet address 192.0.2.37/24set routing-options router-id 10.255.0.2set protocols ospf area 0.0.0.1 interface so-1/0/0set protocols ospf area 0.0.0.2 interface so-1/0/0 secondary

    Step-by-Step Procedure

    To configure a secondary logical interface:

    1. Configure the device interfaces.

      Note: For OSPFv3, on each interface specify the inet6 address family and include the IPv6 address.

      [edit]user@R1# set interfaces so-0/0/0 unit 0 family inet address 192.0.2.45/24
      [edit]user@R2# set interfaces so-1/0/0 unit 0 family inet address 192.0.2.37/24
    2. Configure the router identifier.
      [edit]user@R1# set routing-options router-id 10.255.0.1
      [edit]user@R2# set routing-options router-id 10.255.0.2
    3. On each ABR, configure the primary interface for the OSPF area.

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

      [edit]user@R1# set protocols ospf 0.0.0.1 interface so-0/0/0
      [edit ]user@R2# set protocols ospf 0.0.0.2 interface so-1/0/0
    4. On each ABR, configure the secondary interface for the OSPF area.
      [edit ]user@R1# set protocols ospf area 0.0.0.1 so-0/0/0 secondary
      [edit ]user@R2# set protocols ospf area 0.0.0.2 so-1/0/0 secondary
    5. If you are done configuring the devices, commit the configuration.
      [edit protocols ospf area 0.0.0.1 ]user@host# commit

    Results

    Confirm your configuration by entering the show interfaces, show routing-options, and the show protocols ospf commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

    Configuration on ABR R1:

    user@R1# show interfaces
    so-0/0/0 {unit 0 {family inet {address 192.0.2.45/24;}}}
    user@R1# show routing-optionsrouter-id 10.255.0.1;
    user@R1# show protocols ospf
    area 0.0.0.1 {interface so-0/0/0.0;}
    area 0.0.0.2 {interface so-0/0/0.0 {secondary;}}

    Configuration on ABR R2:

    user@R2# show interfaces
    so-0/0/0 {unit 0 {family inet {address 192.0.2.37/24;}}}
    user@R2# show routing-optionsrouter-id 10.255.0.2;
    user@R2# show protocols ospf
    area 0.0.0.1 {interface so-1/0/0.0;}
    area 0.0.0.2 {interface so-1/0/0.0 {secondary;}}

    Verification

    Confirm that the configuration is working properly.

    Verifying the Secondary Interface

    Purpose

    Verify that the secondary interface appears for the configured area. The Secondary field is displayed if the interface is configured as a secondary interface. The output might also show the same interface listed in multiple areas.

    Action

    From operational mode, enter the show ospf interface detail command for OSPFv2, and enter the show ospf3 interface detail command for OSPFv3.

    Verifying the Interfaces in the Area

    Purpose

    Verify the interfaces configured for the specified area.

    Action

    From operational mode, enter the show ospf interface area area-id command for OSPFv2, and enter the show ospf3 interface area area-id command for OSPFv3..

    Verifying Neighbor Adjacencies

    Purpose

    Verify the primary and secondary neighbor adjacencies. The Secondary field displays if the neighbor is on a secondary interface.

    Action

    From operational mode, enter the show ospf neighbor detail command for OSPFv2, and enter the show ospf3 neighbor detail command for OSPFv3.

    Modified: 2016-12-06