OSPF Configuration Example 2: Multi-Area Setup

Configuring OSPF with Multiple Areas :

Earlier, we covered how to configure OSPF with two routers in the same area. In this guide, we’ll walk through an example of configuring OSPF with multiple areas. Using four routers and three areas, we’ll demonstrate the setup process. The objective of this exercise is to help you understand and verify the routes learned across the areas in this multi-area OSPF setup.

Table of Contents


Topology

A network topology showing OSPF routers in multiple areas, with two routers in Area 1, two routers in Area 0, and two routers in Area 2
OSPF Setup: Routers Distributed Across Three Areas

Understanding the Topology:

As you can see in the above topology, R1 and R2 need to be configured in Area 1, with R2 serving as the ABR (Area Border Router) connecting to Area 0 (Backbone Area). Similarly, on the other side, R3 and R4 are in Area 2, with R3 acting as the ABR connecting Area 2 to Area 0. In OSPF, ABRs generate LSA Type 3 to advertise networks from one area to another. In this example, R2 will learn the routes from Area 1 and send them to Area 0, allowing R3 and R4 to access the networks in Area 1. Likewise, R3 will summarize the routes from Area 2 and generate LSA Type 3 to inform R2 and R1 about those networks.

Configuration Procedure:

  1. Connect the devices as shown in the topology.
  2. Configure IP addresses on all routers’ physical interfaces.
  3. Ping the directly connected devices to ensure connectivity.
  4. Add a loopback interface on each router and configure its IP address.
  5. Configure OSPF for Area 1 between R1 and R2.
  6. Configure OSPF for Area 0 between R2 and R3.
  7. Configure OSPF for Area 2 between R3 and R4.
  8. Wait for the adjacencies to form between the routers.
  9. Verify that R1 has learned the networks advertised from Area 2, and R4 has learned the networks from Area 1.

If you have any doubts about the OSPF network command, refer to this OSPF command description for more details.

Configuration Commands :

Configuring Fasethernet 0/0 with IP address 1.1.1.1/8 and Loopback interface 1 with IP address 10.1.1.1/8 on Router 1:

Configuring OSPF for networks 1.0.0.0 and 10.0.0.0 in Area 1:

Configuring IP address on Router 2 (Fastethernet 0/0 : 1.1.1.2/8 , Fastethernet0/1: 2.1.1.2/8 and Loopback 1: 20.1.1.1/8) :

Configuring OSPF for network 1.0.0.0 in Area 1 and networks 2.0.0.0 and 20.0.0.0 in Area 0 :

IP address (fastethernet 0/1: 2.2.2.3/8 , fastethernet 0/0 : 3.3.3.3/8 , loopback 1 : 30.1.1.1/8 ) and OSPF configuration on Router 3 :

Configuring IP addresses ( fastethernet 0/0 : 3.3.3.4/8, loopback 1 : 40.1.1.1) and OSPF on Router 4 :

If you do not know why the loopback interfaces are used in this example, check out this explanation on the use of loopback interfaces in OSPF from the previous tutorial.


Verifying the Results:

Before checking the OSPF adjacency and the routing table for the learned networks, it’s always a good idea to ensure that Ping is working between directly connected devices. Start by Pinging from R1 to R2, R2 to R3, and R3 to R4.

If all the pings are successful, proceed to check the adjacency status using the “show ip ospf neighbor” command.

A screenshot of a Cisco router's CLI showing the output of 'show ip ospf neighbor' with OSPF neighbors in the FULL state
Output of ‘show ip ospf neighbor’ on R2

In the above screenshot of R2, you can see the output of the “show ip ospf neighbor” command, showing that R2 has reached FULL state adjacency with R1 (Router ID: 10.1.1.1) and R3 (Router ID: 30.1.1.1). Use this command on every router and make sure that all adjacencies have reached the FULL state

Next, check the routing table for OSPF routes using the “show ip route ospf” command.

A screenshot of a Cisco router's CLI showing the output of the 'show ip route ospf' command, displaying inter-area routes
Output of ‘show ip route ospf’ displaying inter-area routes

In the above screenshot taken on R2, you can see the OSPF routes learned from the neighbors R1 and R3. On Cisco routers, OSPF routes within the same area are denoted by the code “O,” while OSPF routes from other areas are denoted by the code “O IA” (which stands for OSPF inter-area routes). In the above output, the first two networks, 3.0.0.0/8 and 40.1.1.1/32, are marked with the code “O IA,” indicating these networks are in Area 2. This means these networks are not in the area to which R2 is connected. The other two networks, 10.1.1.1/32 and 30.1.1.1/32, are marked with the code “O,” which denotes that these networks are within the area to which R2 is connected.

In the same way, check the routing table on every router and ensure that each router has learned all other networks.


Next >>> OSPF Configuration Example 3: DR BDR election

Previous >>> OSPF Configuration Example 1 : Adjacency Formation

Further reading: Cisco


We’d love to hear your feedback and suggestions about this article. Feel free to reach out to us using the WhatsApp number below.

Sajith Achipra has been a trainer and testing consultant at Zframez Technologies since 2009. With 15+ years of experience, he specializes in networking, Python, development, and testing. He conducts online courses to help students and professionals enhance their skills. You can reach him on WhatsApp at +91 8884 884 844 for your training and testing requirements.