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
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:
- Connect the devices as shown in the topology.
- Configure IP addresses on all routers’ physical interfaces.
- Ping the directly connected devices to ensure connectivity.
- Add a loopback interface on each router and configure its IP address.
- Configure OSPF for Area 1 between R1 and R2.
- Configure OSPF for Area 0 between R2 and R3.
- Configure OSPF for Area 2 between R3 and R4.
- Wait for the adjacencies to form between the routers.
- 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:
1. Configuring IP Addresses on physical interface:
R1#configure terminal
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 1.1.1.1 255.0.0.0
R1(config-if)#no shutdown
2. Creating the loopback interface and configuring IP Address:
R1(config-if)#interface loopback 1
R1(config-if)#ip address 10.1.1.1 255.0.0.0
Configuring OSPF for networks 1.0.0.0 and 10.0.0.0 in Area 1:
R1(config)#router ospf 1
R1(config-router)#network 1.0.0.0 0.255.255.255 area 1
R1(config-router)#network 10.0.0.0 0.255.255.255 area 1
R1(config-router)#exit
R1(config)#
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 IP Addresses on physical interfaces:
R2#configure terminal
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 1.1.1.2 255.0.0.0
R2(config-if)#no shutdown
R2(config)#interface fastethernet 0/1
R2(config-if)#ip address 2.1.1.2 255.0.0.0
R2(config-if)#no shutdown
#Creating the loopback interface and configuring the IP Address:
R2(config-if)#interface loopback 1
R2(config-if)#ip address 20.1.1.1 255.0.0.0
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 :
R2(config)#router ospf 1
R2(config-router)#network 1.0.0.0 0.255.255.255 area 1
R2(config-router)#network 2.0.0.0 0.255.255.255 area 0
R2(config-router)#network 20.0.0.0 0.255.255.255 area 0
R2(config-router)#exit
R2(config)#
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 on physical interfaces:
R3#configure terminal
R3(config)#interface fastethernet 0/1
R3(config-if)#ip address 2.2.2.3 255.0.0.0
R3(config-if)#no shutdown
R3(config)#interface fastethernet 0/0
R3(config-if)#ip address 3.3.3.3 255.0.0.0
R3(config-if)#no shutdown
#Creating the loopback interface and configuring the IP Address:
R3(config-if)#interface loopback 1
R3(config-if)#ip address 30.1.1.1 255.0.0.0
#Configuring OSPF for the networks 2.0.0.0 and 30.0.0.0 with Area 0 and 3.0.0.0 with Area 2
R3(config)#router ospf 1
R3(config-router)#network 2.0.0.0 0.255.255.255 area 0
R3(config-router)#network 30.0.0.0 0.255.255.255 area 0
R3(config-router)#network 3.0.0.0 0.255.255.255 area 2
R3(config-router)#exit
R3(config)#
Configuring IP addresses ( fastethernet 0/0 : 3.3.3.4/8, loopback 1 : 40.1.1.1) and OSPF on Router 4 :
1. Configuring IP Addresses on physical interfaces:
R4#configure terminal
R4(config)#interface fastethernet 0/0
R4(config-if)#ip address 3.3.3.4 255.0.0.0
R4(config-if)#no shutdown
2. Creating the loopback interface and configuring the IP Address:
R4(config-if)#interface loopback 1
R4(config-if)#ip address 40.1.1.1 255.0.0.0
3. Configuring OSPF for the networks 3.0.0.0 and 40.0.0.0 with Area 2
R4(config)#router ospf 1
R4(config-router)#network 3.0.0.0 0.255.255.255 area 2
R4(config-router)#network 40.0.0.0 0.255.255.255 area 2
R4(config-router)#exit
R4(config)#
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.
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.
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.
About The Author:
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.