OSPF multi-area is a type of network design that requires area 0 (the backbone area), and one or more non-backbone standard/stub areas.

Managing an OSPF routing domain using one area is a bad OSPF design in large networks. Instead, implementing an OSPF multi-area topology would be the most efficient choice. OSPF Single area design makes configuring easy, but it is challenging to scale and increase the consumption of CPU cycles to manage OSPF traffic, build adjacencies, and compute the SPF tree.

OSPF Multi-Area Configuration

Configuring an OSPF multi-area network is similar to configuring a single-area network, except that interfaces are placed in different areas, including the backbone area, instead of one area.

Here are the commands to issue on each router in order to set up an OSPF multi-area network:

  1. Create an OSPF process using the router ospf process_id command in global configuration mode, where process_id is an integer between 1and 65535, and represents the identifier of the OSPF instance you are enabling.
  2. Set a router ID for the OSPF process using the router-id rid command, where rid is a number in IP address format between 0.0.0.1 and 255.255.255.255. This command is optional because OSPF has a procedure to set the router ID.
  3. Assign each router interface to the corresponding  OSPF area either using the network command or ip ospf area command. The easiest way to use the network command is by applying the network ip_address 0.0.0.0 area area_id statement, where ip_address is the interface’s IP address, and area_id is the ID of an OSPF area. You can enter area_id as a decimal value between 0 and 4294967295 or as an IP address ranging between 0.0.0.0 and 255.255.255.255. Moreover, you use the ip ospf process_id area area_id command to advertise a router interface into OSPF, where process_id is the ID of an OSPF instance, and area_id is the ID of an OSPF area.

Routing inside OSPF Multi-Area Domain with ABRs?

an ABR is an OSPF node that is connected to the backbone area and one or more non-backbone areas. A router connected to many areas cannot share LSAs between areas unless it is connected to area 0.

For example, router R2, in the network topology below, is connected to areas 12 and 23. It does not have an interface advertised in area 0. Therefore, it doesn’t share LSAs describing IP prefixes in areas 0, 23, and 45 with router R1, and thus router R1 would have routes to subnets 10.0.23.0/24, 10.0.34.0/24 and 10.0.45.0/24.

Likewise, R2 does not advertise area 12’s only subnet (10.0.12.0/24) with router R3. This way, routers R3, R4, and R5 would not learn about that subnet.

To solve this issue, we can set up an OSPF virtual link between R2 and R3 or create a GRE tunnel between those routers and advertise it in area 0. Implementing an OSPF virtual link won’t affect the IP address scheme of the OSPF domain, but the second option may do.

In the next lab, you will learn the command you may use to solve this issue.

OSPF Multi-Area Configuration Lab on Cisco Packet Tracer

In this lab, we configure OSPF according to the following network diagram. Click here to download the packet tracer lab file.

Network Topology

Tasks

Task 1: Configure hostnames and IP addresses on the routers based on the network topology.

Router R1

Router(config)# hostname R1
R1(config)# 
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip address 10.0.12.1 255.255.255.0
R1(config-if)# no shutdown

Router R2

Router(config)# hostname R2
R2(config)# 
R2(config)# interface GigabitEthernet0/0
R2(config-if)# ip address 10.0.12.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# 
R2(config-if)# interface GigabitEthernet0/1
R2(config-if)# ip address 10.0.23.2 255.255.255.0
R2(config-if)# no shutdown

Router R3

Router(config)# hostname R3
R3(config)# 
R3(config)# interface GigabitEthernet0/1
R3(config-if)# ip address 10.0.23.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# 
R3(config-if)# interface GigabitEthernet0/0
R3(config-if)# ip address 10.0.34.3 255.255.255.0
R3(config-if)# no shutdown

Router R4

Router(config)# hostname R4
R4(config)# 
R4(config)# interface GigabitEthernet0/0
R4(config-if)# ip address 10.0.34.4 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# 
R4(config-if)# interface GigabitEthernet0/1
R4(config-if)# ip address 10.0.45.4 255.255.255.0
R4(config-if)# no shutdown

Router R5

Router(config)# hostname R5
R5(config)# 
R5(config)# interface GigabitEthernet0/1
R5(config-if)# ip address 10.0.45.5 255.255.255.0
R5(config-if)# no shutdown

Task 2: Configure our OSPF multi-area network according to the table below.

Router Router ID Interface IP Address OSPF Area
R1 1.1.1.1 GigabitEthernet 0/0 10.0.12.1/24 Area 12
R2 2.2.2.2 GigabitEthernet 0/0 10.0.12.2/24 Area 12
GigabitEthernet 0/1 10.0.23.2/24 Area 23
R3 3.3.3.3 GigabitEthernet 0/1 10.0.23.3/24 Area 23
GigabitEthernet 0/0 10.0.34.3/24 Area 0
R4 4.4.4.4 GigabitEthernet 0/0 10.0.34.4/24 Area 0
GigabitEthernet 0/1 10.0.45.4/24 Area 45
R5 5.5.5.5 GigabitEthernet 0/1 10.0.45.5/24 Area 45

Router R1

R1(config-if)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 10.0.12.1 0.0.0.0 area 12

Router R2

R2(config-if)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 10.0.12.2 0.0.0.0 area 12
R2(config-router)# network 10.0.23.2 0.0.0.0 area 23

Router R3

R3(config-if)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 10.0.23.3 0.0.0.0 area 23
R3(config-router)# network 10.0.34.3 0.0.0.0 area 0

Router R4

R4(config-if)# router ospf 1
R4(config-router)# router-id 4.4.4.4
R4(config-router)# network 10.0.34.4 0.0.0.0 area 0
R4(config-router)# network 10.0.45.4 0.0.0.0 area 45

Router R5

R5(config-if)# router ospf 1
R5(config-router)# router-id 5.5.5.5
R5(config-router)# network 10.0.45.5 0.0.0.0 area 45

To verify our solution, we use the show ip ospf neighbor, show ip ospf interface brief, and show ip route commands to check that OSPF adjacencies have been established, router interfaces have been configured in the right areas, and routers have full IP reachability to all subnets in the routing domain.

The following show ip ospf neighbor command outputs demonstrate that routers are forming full OSPF neighbor relationships according to the network topology, which is requiring the routers to form five OSPF adjacencies.

Router R2

R2# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:36    10.0.12.1       GigabitEthernet0/0
3.3.3.3           1   FULL/DR         00:00:37    10.0.23.3       GigabitEthernet0/1

Router R4

R4# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:34    10.0.34.3       GigabitEthernet0/0
5.5.5.5           1   FULL/DR         00:00:32    10.0.45.5       GigabitEthernet0/1

The show ip ospf interface brief command outputs indicate that OSPF is configured on all router interfaces per the task’s requirements.

Router R1

R1# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        1     12              10.0.12.1/24       1     BDR   1/1

Router R2

R2# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        1     12              10.0.12.2/24       1     DR    1/1
Gi0/1        1     23              10.0.23.2/24       1     BDR   1/1

Router R3

R3# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        1     0               10.0.34.3/24       1     BDR   1/1
Gi0/1        1     23              10.0.23.3/24       1     DR    1/1

Router R4

R4# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        1     0               10.0.34.4/24       1     DR    1/1
Gi0/1        1     45              10.0.45.4/24       1     BDR   1/1

Router R5

R5# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/1        1     45              10.0.45.5/24       1     DR    1/1

Finally, we check that routers have learned all subnets in the network. The network consists of four subnets. Therefore, the number of OSPF routes in the routing table of a router equals four minus the number of its connected subnets.

The following table list the number of OSPF routes that should be learned in order to have full IP reachability to the network’s subnets.

Router Number of connected routes Number of OSPF routes to learn OSPF routes to learn
R1 1 3 10.0.23.0/24, 10.0.34.0/24, and 10.0.45.0/24
R2 2 2 10.0.34.0/24 and 10.0.45.0/24
R3 2 2 10.0.12.0/24, and 10.0.45.0/24
R4 2 2 10.0.12.0/24, and 10.0.23.0/24
R5 1 3 10.0.12.0/24, 10.0.23.0/24, and 10.0.34.0/24

The show ip route ospf command outputs state that router R2 is the only router that routes to all subnets in the network, R1 does not have routes to subnets in areas 0, 23, and 45, and routers R3, R4, and R5 do not have a route to subnet 10.0.12.0/24.

Routers R1, R3, R4, and R5 do not have OSPF routes to all subnets in the routing domain because R2 is not an ABR.

Router R1

R1# show ip route ospf


omitted output

Gateway of last resort is not set

R1#

Router R2

R2# show ip route ospf


omitted output

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA     10.0.34.0/24 [110/2] via 10.0.23.3, 01:12:18, GigabitEthernet0/3
O IA     10.0.45.0/24 [110/3] via 10.0.23.3, 01:12:06, GigabitEthernet0/3

Router R3

R3# show ip route ospf


omitted output

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     10.0.45.0/24 [110/2] via 10.0.34.4, 01:12:45, GigabitEthernet0/4

Router R4

R4# show ip route ospf


omitted output

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     10.0.23.0/24 [110/2] via 10.0.34.3, 01:13:37, GigabitEthernet0/3

Router R5

R5# show ip route ospf


omitted output

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA     10.0.23.0/24 [110/3] via 10.0.45.4, 01:13:44, GigabitEthernet0/4
O IA     10.0.34.0/24 [110/2] via 10.0.45.4, 01:13:44, GigabitEthernet0/4

Task 3: Configure the network so that routers R1, R3, R4, and R5 have full IP reachability to all subnets outside area 12.

Since router R2 is not an ABR, it won’t share routes learned from router R3 with router R1, and vice versa. To solve this issue, we configure an OSPF virtual link between R2 and R3 across area 23.

Router R2

R2(config)# router ospf 1
R2(config-router)# area 23 virtual-link 3.3.3.3

Router R3

R3(config)# router ospf 1
R3(config-router)# area 23 virtual-link 2.2.2.2

The show ip ospf virtual-links command output below states that the OSPF virtual link has been successfully established.

R2# show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 3.3.3.3 is up
  Run as demand circuit
  DoNotAge LSA allowed.
  Transit area 23, via interface GigabitEthernet0/1
 Topology-MTID    Cost    Disabled     Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:08
    Adjacency State FULL (Hello suppressed)
    Index 1/1/3, retransmission queue length 0, number of retransmission 0
    First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
    Last retransmission scan length is 0, maximum is 0
    Last retransmission scan time is 0 msec, maximum is 0 mse

Finally, the following show ip route ospf command outputs indicate that the issue has been fixed.

Router R1

R1# show ip route ospf



omitted output

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     10.0.23.0/24 [110/2] via 10.0.12.2, 00:09:38, GigabitEthernet0/0
O IA     10.0.34.0/24 [110/3] via 10.0.12.2, 00:08:52, GigabitEthernet0/0
O IA     10.0.45.0/24 [110/4] via 10.0.12.2, 00:08:52, GigabitEthernet0/0

Router R3

R3# show ip route ospf



omitted output

      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA     10.0.12.0/24 [110/2] via 10.0.23.2, 00:09:07, GigabitEthernet0/1
O IA     10.0.45.0/24 [110/2] via 10.0.34.4, 00:30:00, GigabitEthernet0/0

Router R4

R4# show ip route ospf



omitted output

      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA     10.0.12.0/24 [110/3] via 10.0.34.3, 00:09:17, GigabitEthernet0/0
O IA     10.0.23.0/24 [110/2] via 10.0.34.3, 00:30:09, GigabitEthernet0/0

Router R5

R5# show ip route ospf



omitted output

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     10.0.12.0/24 [110/4] via 10.0.45.4, 00:09:24, GigabitEthernet0/1
O IA     10.0.23.0/24 [110/3] via 10.0.45.4, 00:30:05, GigabitEthernet0/1
O IA     10.0.34.0/24 [110/2] via 10.0.45.4, 00:30:05, GigabitEthernet0/1

Related Lessons to OSPF Multi-Area

Mohamed Ouamer is a computer science teacher and a self-published author. He taught networking technologies and programming for more than fifteen years. While he loves to share knowledge and write, Mohamed's best passions include spending time with his family, visiting his parents, and learning new things.