OSPFOSPF Config

area [id]

Configures an OSPF area and enters OSPF area configuration mode on Cisco IOS-XR.

Overview

The 'area' command in Cisco IOS-XR OSPF configuration is used to define an OSPF area and enter area configuration mode. OSPF (Open Shortest Path First) is a link-state routing protocol that divides the network into areas to improve scalability and reduce routing overhead. Each area maintains its own link-state database (LSDB), and only summary routes are advertised between areas. The backbone area (area 0) is the core of the OSPF network; all other areas must connect to it. The 'area' command allows you to specify the area ID (either a decimal number or an IP address) and then configure area-specific parameters such as interface membership, area type (stub, NSSA, etc.), authentication, and cost. On IOS-XR, the command is entered under the OSPF process configuration mode (router ospf <process-name>). This command is essential for designing and implementing multi-area OSPF networks, which are common in large enterprise and service provider environments. It fits into troubleshooting workflows when verifying area boundaries, checking LSA flooding, or diagnosing adjacency issues between routers in different areas.

Syntax·OSPF Config
area {area-id}

When to Use This Command

  • Define a backbone area (area 0) for an OSPF domain.
  • Create a stub area to reduce routing table size in a branch office.
  • Configure a not-so-stubby-area (NSSA) to import external routes while maintaining stub characteristics.
  • Segment a large OSPF domain into multiple areas for better scalability and administrative control.

Parameters

ParameterSyntaxDescription
area-idarea-idThe OSPF area identifier. It can be specified as a decimal number (e.g., 0, 1, 2) or in IP address format (e.g., 0.0.0.0, 0.0.0.1). The area ID must be unique within the OSPF domain. Area 0 is reserved for the backbone area.

Command Examples

Enter OSPF area 0 configuration

RP/0/RP0/CPU0:router(config-ospf)# area 0
RP/0/RP0/CPU0:router(config-ospf-ar)#

The prompt changes to indicate OSPF area configuration mode for area 0. From here, you can configure area-specific parameters like interfaces, authentication, and area type.

Configure a stub area

RP/0/RP0/CPU0:router(config-ospf)# area 1 stub
RP/0/RP0/CPU0:router(config-ospf-ar)#

The 'stub' keyword is appended to the area command. This configures area 1 as a stub area, which prevents Type 5 LSAs from being flooded into the area.

Understanding the Output

The command does not produce a direct output; instead, it changes the CLI prompt to indicate that you are now in OSPF area configuration mode. The prompt changes from 'router(config-ospf)#' to 'router(config-ospf-ar)#'. This mode allows you to configure area-specific OSPF parameters such as interfaces, authentication, area type (stub, NSSA), and cost. To verify the configuration, use commands like 'show ospf' or 'show running-config'. A healthy configuration will show the area correctly defined with the desired parameters. Common issues include missing area definitions or incorrect area type configurations that can lead to OSPF adjacency problems.

Configuration Scenarios

Configuring a Multi-Area OSPF Network

A company has a central office (area 0) and two branch offices (area 1 and area 2). All routers run IOS-XR.

Topology

Area 0 R1 ---------- R2 | | Area 1 Area 2 | | R3 R4

Steps

  1. 1.Configure OSPF process on all routers.
  2. 2.On R1, configure area 0 and area 1, and assign interfaces to each area.
  3. 3.On R2, configure area 0 and area 2, and assign interfaces.
  4. 4.On R3, configure area 1 and assign its interface.
  5. 5.On R4, configure area 2 and assign its interface.
Configuration
! On R1
router ospf 1
 area 0
  interface GigabitEthernet0/0/0/0
 !
 area 1
  interface GigabitEthernet0/0/0/1
  stub
 !
! On R2
router ospf 1
 area 0
  interface GigabitEthernet0/0/0/0
 !
 area 2
  interface GigabitEthernet0/0/0/1
  nssa
 !

Verify: Use 'show ospf neighbor' to verify adjacencies. Use 'show ospf database' to check LSDB contents per area.

Watch out: Ensure that area 0 is configured on both R1 and R2; otherwise, inter-area routing will fail.

Troubleshooting with This Command

When troubleshooting OSPF area configuration on Cisco IOS-XR, start by verifying that the area is correctly defined using 'show running-config router ospf'. Check that interfaces are assigned to the correct area with 'show ospf interface'. If OSPF adjacencies are not forming, use 'show ospf neighbor' to see the state. Common issues include mismatched area IDs, area type mismatches (e.g., one router configured as stub and the other as normal), or authentication mismatches. Use 'debug ospf adj' to see adjacency events. For LSA flooding issues, 'show ospf database' can reveal missing or unexpected LSAs. On IOS-XR, the 'area' command is straightforward, but ensure that area 0 exists and that all non-backbone areas have a path to it. If a router is configured as an ABR (Area Border Router), it must have interfaces in area 0 and at least one other area. Use 'show ospf border-routers' to verify ABR status.

CCNA Exam Tips

1.

Remember that area 0 is mandatory for all OSPF networks; all other areas must connect to area 0.

2.

Know the difference between stub, totally stubby, NSSA, and totally NSSA areas, and which LSA types are allowed in each.

3.

On IOS-XR, the 'area' command is entered under the OSPF process configuration, not directly under router ospf.

Common Mistakes

Forgetting to configure area 0 as the backbone; all non-backbone areas must connect to area 0.

Misconfiguring area type (e.g., making an area stub when it should be NSSA) causing routing issues.

Not specifying the area ID correctly; area ID can be a number or an IP address, but must be consistent across routers.

Platform Notes

On Cisco IOS-XR, the OSPF configuration is hierarchical: you first enter 'router ospf <process-name>', then use 'area <area-id>' to enter area configuration mode. This differs from classic IOS where area parameters are configured directly under router ospf. IOS-XR also supports multiple OSPF instances. The 'area' command syntax is similar to IOS, but IOS-XR requires explicit interface assignment under the area. There is no 'network' command; instead, interfaces are configured under the area. This is a key difference. For equivalent commands on other platforms, Juniper Junos uses 'set protocols ospf area <area-id> interface <interface>', while Arista EOS uses 'router ospf <process> network <ip> <wildcard> area <area-id>'. IOS-XR version differences are minimal; the command has been consistent since early XR releases.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions