Introduction to Multi Area OSPF

Continuing from a previous blog post about OSPF, in this blog post I will try to show you some advantages of having multiple OSPF areas, and then we'll design and configure our network with a couple of areas.

Why multiple OSPF areas?

First, we reduce the size of routing tables. Each area can contain multiple Routers and Hosts and cover a portion of a network that can frequently be summarized.

Multi-area OSPF network design could look like something like this:

 

There's a backbone area in OSPF network (Area 0) and all the areas must connect to it. Packets travelling between the areas must go through at least one backbone Router.

Routers in one Area know about the networks in another area, but they don't know the inner details of another area. This means we have smaller topology tables inside an Area. When the topology table is smaller, Routers use less resources to calculate the best routes.

In order to be able to truly step out the single-area OSPF comfort-zone we need to understand the different types of OSPF routers. Also, we didn't touch the concept of OSPF router types in previous blog post, so this is a great time to do this.

Types of OSPF routers:

  • ABR - Area Border Router

    Area Border Router is a Router that connects two or more OSPF areas together, meaning it has interfaces in both areas.
  • ASBR - Autonomous System Border Router

    ASBR is a Router that injects external routes into OSPF. By external routes it' s mostly BGP-learned routes and static routes. However, it could also mean EIRGP-routes.

Now we know about different types of routers. Let's try to create and configure a Multi-area OSPF network.

Configuration Example

We'll use this network design:

This time we won't have any "hosts", we'll test connectivity by pinging the Router interfaces which do have the first addresses in the appropriate networks. The interface addresses are:

  • R4 -> 192.168.4.1/24
  • R5 -> 10.1.5.1/24
  • R6 -> 10.1.60.1/24

The other networks between the routers are:

  • R2 - ABR1 -> 172.16.0.0/30
  • R2 - ABR2 -> 172.16.0.4/30
  • ABR1 - ABR2 -> 172.16.0.8/30
  • ABR1 - R5 -> 172.16.1.0/30
  • R5 - R6 -> 172.16.1.4/30
  • ABR2 - R4 -> 172.16.2.0/30

OK, enough talk, let's configure our little OSPF network. We'll start from top to bottom, meaning we'll start from Area 0 and with R2. We'll configure both the Interfaces and OSPF at once, so we don't have to return later. On R2, we'll configure RID manually.

R2(config)#int f0/0
R2(config-if)#ip add 172.16.0.1 255.255.255.252
R2(config-if)#no shut
 
R2(config-if)#int s1/0
R2(config-if)#ip add 172.16.0.5 255.255.255.252
R2(config-if)#no shut

OK, now for OSPF on R2:

R2(config-if)#router ospf 200
R2(config-router)#router-id ?
  A.B.C.D  OSPF router-id in IP address format
 
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 172.16.0.0 0.0.0.3 area 0
R2(config-router)#network 172.16.0.4 0.0.0.3 area 0

OK, R2 was simple. Now, let's configure ABR1. This time, we'll use Loopback Interface address as Router-ID. First, let's configure the interfaces:

ABR1(config)#int f0/0
ABR1(config-if)#ip add 172.16.0.2 255.255.255.252
ABR1(config-if)#no shut
 
ABR1(config-if)#int f2/0
ABR1(config-if)#ip add 172.16.0.9 255.255.255.252
ABR1(config-if)#no shut
 
ABR1(config-if)#int f1/0
ABR1(config-if)#ip add 172.16.1.1 255.255.255.252
ABR1(config-if)#no shut
 
ABR1(config-if)#int Loopback 0
ABR1(config-if)#
*Mar  1 00:04:35.851: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
ABR1(config-if)#ip add 1.1.1.1 255.255.255.255

And now OSPF:

ABR1(config-if)#router ospf 1
ABR1(config-router)#network 172.16.0.0 0.0.0.3 area 0
ABR1(config-router)#
*Mar  1 00:05:34.019: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
ABR1(config-router)#network 172.16.0.8 0.0.0.3 area 0

Also, don't forget this is an ABR, meaning it also connects to Area 1. The network 172.16.1.0/30 is between ABR1 and R5, which means it belongs to Area 1:

ABR1(config-router)#network 172.16.1.0 0.0.0.3 area 1

Now, let's configure ABR2 in the same manner. Only, this time, we'll let the Router ID be the address of a physical interface.

ABR2(config)#int serial 0/0
ABR2(config-if)#ip address 172.16.0.6 255.255.255.252
ABR2(config-if)#no shutdown
 
ABR2(config)#interface fastEthernet 2/0
ABR2(config-if)#ip add 172.16.0.10 255.255.255.252
ABR2(config-if)#no shut
 
ABR2(config-if)#int f1/0
ABR2(config-if)#ip add 172.16.2.1 255.255.255.252
ABR2(config-if)#no shut

And now for OSPF on ABR2:

ABR2(config)#router ospf 2
ABR2(config-router)#network 172.16.0.8 0.0.0.3 area 0
ABR2(config-router)#
*Mar  1 00:06:15.231: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on FastEthernet2/0 from LOADING to FULL, Loading Done
ABR2(config-router)#network 172.16.0.4 0.0.0.3 area 0
ABR2(config-router)#
*Mar  1 00:06:28.471: %OSPF-5-ADJCHG: Process 2, Nbr 2.2.2.2 on Serial0/0 from LOADING to FULL, Loading Done
ABR2(config-router)#network 172.16.2.0 0.0.0.3 area 2

OK, now, let's get into Area 1. This time, we'll use another way to configure OSPF. Also, take note that both R5 and R6 have the host network connecting to them which means we'll configure passive interfaces as well, because OSPF updates don't need to be sent to the host-only subnet. We'll start with R5.

We'll configure Interface addresses and enable OSPF on them at the same time.

Observe:

R5(config)#interface fastEthernet 0/0
R5(config-if)#ip address 172.16.1.2 255.255.255.252
R5(config-if)#no shut
R5(config-if)#
*Mar  1 00:02:53.943: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:02:54.943: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R5(config-if)#ip ospf 5 area 1
R5(config-if)#
*Mar  1 00:03:08.979: %OSPF-5-ADJCHG: Process 5, Nbr 1.1.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done

See what we did there? We used ip ospf <process> area <area> interface subcommand to enable OSPF on the interface. This way we don't need the OSPF network subcommand. Now let's do the same for other interfaces:

R5(config-if)#int s1/0
R5(config-if)#ip add 172.16.1.5 255.255.255.252
R5(config-if)#no shut
R5(config-if)#ip ospf 5 area 1
 
R5(config-if)#int fast 2/0
R5(config-if)#ip add 10.1.5.1 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#ip ospf 5 area 1

Now, let's just make FastEthernet 2/0 Interface passive because that Interface connects to the hosts-only subnet:

R5(config-if)#router ospf 5
R5(config-router)#passive-interface fa2/0

That's basically it for R5. Now for R6. Nothing new here, same deal as R5. Only, this time, we'll reverse the order just a little bit. First, let's configure Loopback interface so that we get Router ID from it, and then configure the passive interface. At the end we'll configure interface addresses and enable OSPF on those interfaces:

R6(config)#int lo0
R6(config-if)#
*Mar  1 00:00:55.491: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R6(config-if)#ip add 6.6.6.6 255.255.255.255
R6(config-if)#router ospf 600
R6(config-router)#passive-interface fa1/0

And now, let's configure interface addresses and enable OSPF on them:

R6(config-router)#int fa1/0
R6(config-if)#ip add 10.1.60.1 255.255.255.0
R6(config-if)#no shut
R6(config-if)#
*Mar  1 00:03:22.795: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Mar  1 00:03:23.795: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R6(config-if)#ip ospf 600 area 1
 
R6(config-if)#int s0/0
R6(config-if)#ip add 172.16.1.6 255.255.255.252
R6(config-if)#no shut
R6(config-if)#
*Mar  1 00:04:17.795: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
*Mar  1 00:04:18.799: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R6(config-if)#ip ospf 600 area 1
R6(config-if)#
*Mar  1 00:04:30.203: %OSPF-5-ADJCHG: Process 600, Nbr 172.16.1.2 on Serial0/0 from LOADING to FULL, Loading Done

So, what did we achieve? We fully configured Areas 0 and 1, which means R6 can now ping R1:

R6#ping 172.16.0.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 576/848/1376 ms

OK, now just for Area 2, so that all routers can communicate with each other.

We already configured ABR2, only R4 remains. So, let's configure it:

R4(config)#int f0/0
R4(config-if)#ip add 172.16.2.2 255.255.255.252
R4(config-if)#no shut
 
R4(config-if)#int f1/0
R4(config-if)#ip add 192.168.4.1 255.255.255.0
R4(config-if)#no shut

And now for OSPF:

R4(config-if)#router ospf 4
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 192.168.4.0 0.0.0.255 area 2
R4(config-router)#network 172.16.2.0 0.0.0.3 area 2
R4(config-router)#
*Mar  1 00:02:46.187: %OSPF-5-ADJCHG: Process 4, Nbr 172.16.2.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
R4(config-router)#passive f1/0

That's it! We configured Multi-Area OSPF. Now all points in the network are reachable from every router. Let's try to access 10.1.5.1 (R5's Fast Ethernet 2/0 interface) address from R4:

R4#ping 10.1.5.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 424/572/772 ms

OK, great! This means we can send the packet there and it can return. Now let's briefly analyze R5's routing table:

R5#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     172.16.0.0/30 is subnetted, 6 subnets
O IA    172.16.0.8 [110/2] via 172.16.1.1, 00:29:21, FastEthernet0/0
O IA    172.16.0.4 [110/66] via 172.16.1.1, 00:29:21, FastEthernet0/0
C       172.16.1.4 is directly connected, Serial1/0
O IA    172.16.0.0 [110/2] via 172.16.1.1, 00:29:21, FastEthernet0/0
C       172.16.1.0 is directly connected, FastEthernet0/0
O IA    172.16.2.0 [110/3] via 172.16.1.1, 00:03:22, FastEthernet0/0
O IA 192.168.4.0/24 [110/4] via 172.16.1.1, 00:03:22, FastEthernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.5.0 is directly connected, FastEthernet2/0
O       10.1.60.0 [110/65] via 172.16.1.6, 00:29:34, Serial1/0

Note the Inter-Area routes marked with IA. These are the routes from Areas 0 and 2. These are the routes whose LSA the ABR1 advertised into Area 1. Let's take a look at the topology table on R5:

R5#show ip ospf database
 
            OSPF Router with ID (172.16.1.2) (Process ID 5)
 
                Router Link States (Area 1)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1263        0x80000009 0x00267E 1
6.6.6.6         6.6.6.6         1583        0x80000005 0x006273 3
172.16.1.2      172.16.1.2      1583        0x80000011 0x00C10A 4
 
                Net Link States (Area 1)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.1      1.1.1.1         1520        0x80000004 0x00466D
 
                Summary Net Link States (Area 1)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.0.0      1.1.1.1         1263        0x80000004 0x00D7A3
172.16.0.4      1.1.1.1         755         0x80000004 0x003205
172.16.0.8      1.1.1.1         1263        0x80000004 0x0087EB
172.16.2.0      1.1.1.1         14          0x80000001 0x00D1A9
192.168.4.0     1.1.1.1         15          0x80000001 0x00AB1D

What does topology table from R5 show us? It shows us that R5 has information about the details of Area 1, and that it has summary information about Areas 0 and 2 which ABR1 advertised into Area 1.

Same thing is on R2. It has the routes from LSAs ABR1 and ABR2 advertised into Area 0:

R2#show ip route ospf
     172.16.0.0/30 is subnetted, 6 subnets
O       172.16.0.8 [110/2] via 172.16.0.2, 02:05:37, FastEthernet0/0
O IA    172.16.1.4 [110/66] via 172.16.0.2, 00:46:53, FastEthernet0/0
O IA    172.16.1.0 [110/2] via 172.16.0.2, 01:15:34, FastEthernet0/0
O IA    172.16.2.0 [110/3] via 172.16.0.2, 00:20:17, FastEthernet0/0
O IA 192.168.4.0/24 [110/4] via 172.16.0.2, 00:20:17, FastEthernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.1.5.0 [110/3] via 172.16.0.2, 01:08:46, FastEthernet0/0
O IA    10.1.60.0 [110/67] via 172.16.0.2, 00:46:44, FastEthernet0/0

Interesting is that R2 reaches 192.168.4.0/24 network through ABR1. That's because ABR1 and ABR2 are connected via Fast Ethernet and R2 and ABR2 via Serial link, so the route through ABR1 is the shortest path.

OK, that's it for this blog post. This was basically an introduction into Multi Area OSPF. I hope you learned something about it. In some future blog post we'll go deeper into OSPF and learn other cool things about it, including one of the great advantages of Multi Area OSPF: Summarization.

Also, for those who miss posts Web Development and Web Design categories I hope to have something ready soon.

Until next time I wish you all the best!

Comments are closed