Cisco OSPF Areas Tutorial

In this Cisco CCNA tutorial, you’ll learn about OSPF areas. Scroll down for the video and also text tutorial.

Cisco OSPF Areas Video Tutorial

YouTube Video

Sunaina Karanwal

Sunaina Karanwal

I am brand new to this material. I can only say that you’ve actually made it so incredibly easy for me to understand all of this, that I am very grateful.

Thanks again for your awesome course! I really dislike video learning but still very very much enjoy yours!

Sunaina Karanwal

 

With our link-state routing protocols, every router learns the full picture if it's part of a network, including every router, its interfaces, and what they connect to. This can cause issues in a large network because every router knows about every link, there's going to be a lot of routes in its routing table, and that can take up too much memory.

 

Also, if there's a change in the network, like a new link being added, or a link going down, that causes all routers to re-converge, which takes time and CPU resources. The larger the network is, the bigger impact that this is going to have.

 

Cisco OSPF Areas

 

To mitigate against this, OSPF supports a hierarchical design which segments large networks into smaller areas. Each route maintains full information about its own area, but only summary information about other areas.

 

The routers are going to have less routes in their routing table, and if a new link comes up or goes down in another area, it's not going to affect that router.

 

Cisco OSPF Areas 1

 

We have a two-level hierarchy. At the top level, we've got the transit area, also known as the backbone, or Area 0. It does not generally contain end users when we've got a multi-area network.

 

We've also got our regular areas, also known as our nonbackbone areas, which hang below Area 0. They're used to connect end users to the transit area. By default, all transit traffic goes through the transit area.

 

In the example diagram here, we've got Area 0, and Area 1 and Area 2 are hanging off of there. Any traffic between other areas, not Area 0, always has to go through Area 0. We can't have traffic going directly between Area 1 and Area 2.

 

Cisco OSPF Areas 2

 

Now, multiple areas are really only required if you've got a larger network. If you've got a small network, there's less destination network. There will be less routes, so it's not a problem if our routers know about all of those different routes. In that case, we don't need the hierarchical design, and all routers can be in Area 0.

 

Later on, if your network grows, and you went to go to a multi-area design, this makes it really easy to migrate.

 

OSPF Configuration - network

 

For the configuration of the different areas, the area is configured at the interface level with the network command:

network 10.0.0.0 0.0.255.255 area 0

 

Any interfaces on this router, which have got an IP address, which falls within that range will be enabled for OSPF and put in Area 0. For our router to form an adjacency, its neighbor on the other side of the link must be configured to be in the same area.

 

If you've got an area mismatch, the adjacency isn't going to come up, and the routers are not going to share routes with each other.

 

OSPF Configuration - network

 

OSPF Router Types – Backbone Routers

 

Moving on to our different router types. First off, we've got our backbone routers. A backbone router is a router where all its interfaces are in Area 0. This forms part of the transit area. With OSPF, routers maintain a full link state database of other writers and links in their own area.

 

Your backbone routers will have the full link state database for all of the other links that are also in Area 0.

 

OSPF Router Types – Backbone Routers

 

Internal Routes

 

Whenever an OSPF route is received from a neighbor, and that neighbor is in the same area, it will show up in a table as an intra-area route. You see in the example below shows the output of the command "show ip route", all the different types that are showing in bold, are different types of OSPF routes.

 

We can have intra area routes, which means the destination network is in the same area, an inter-area, route, where it's in a different area, or an external route. Meaning, it was redistributed into OSPF. In the example here, we've got three routes. The prefix for all of them is O, so these are all intra area routes received from the same area.

 

Internal Routes

OSPF Router Types - ABRs

 

The next type of router we've got, is the ABR, our Area Border Router. Routers that have interfaces and multiple areas are ABRs. In the example below, I've highlighted the drivers in red. I've got a router on the left here, which has got one interface in Area 0, and another interface in Area 1. Our other ABR has got an interface in Area 0, and another interface in Area 2.

 

OSPF Router Types - ABRs

 

The characteristics of the ABRs. They separate the flooding zones. This is what really segregates our network into the different areas, and compartmentalizing our network. If we have a link, goes up or goes down in that area, it's going to keep the information just in that one area, it doesn't impact our other areas.

 

The ABR is also where we always do our summarization in OSPF. An OSPF summarization is always done on your ABRs. It functions regularly as a resource for default routes. For other normal areas, normal routers in our normal areas, and it maintains the link state database for each area with which it is connected.

 

OSPF Router Types - ABRs 1

 

In the example, it's going to have the full links state database for Area 0, so it knows about all the individual networks in Area 0. It also has the full link state database for Area 1. Our ABR on the right here will have a full STB for Area 0 and for Area 2, but it only has summary information for Area 1.

 

Manual Summarization

 

The ideal design is to have each ABR connected to two areas only, the backboard and another normal area. An important point is that your ABRs do not automatically summarize, you need to do this manually. If you don't manually configure summarization, all routes will be flooded everywhere, so the network will basically behave like it was all in one big area.

 

The point of doing our multiple areas for larger networks takes up less resources, puts a less load on the routers. You don't need to just configure the different areas, but you also need to configure summarization on ABRs to really get any benefit from it.

 

R2 is our ABR. It's got an interface in Area 0, which is Fast Ethernet 1/0, and Fast Ethernet 0/0 is in Area 1. In the global config, we say:

router ospf 1

network 10.1.0.0 0.0.255.255 area 0

 

That will put interface Fast Ethernet 1/0 into Area 0. The network 10.0.0.0 0.0.255.255 goes in Area 1, with Fast Ethernet 0/0. Then to get the benefit of our different areas, we need to do summarization on the ABR. You'll notice that we've got all of our networks over here on the left, in Area 0. We've got 10.1.1.0/24 and 10.1.0.0/24. The networks that begin with 10.1.X.X/24 can be summarized to 10.1.0.0/16.

 

Manual Summarization

 

The command to do that, the routes are in Area 0, so I say:

area 0 range 10.1.0.0 255.255.0.0

 

For the network in Area 1, my routes there are 10.0.0.0/24, 10.0.1.0/24, and 10.0.2.0/24. All of the networks over on the right begin with 10.0 and they're /24s. Rather than advertising all of those individual /24 networks over to Area 0 on the left, I'm going to summarize it to a single /16 route.

 

The command I enter is:

area 1 range 10.0.0.0 255.255.0.0

 

The effect that you'll get from this now, is for R1 over in Area 0, rather than having routes to 10.0.0/24, 10.0.1/24, and 10.0.2/24, it just has a single summary route for 10.0.0.0/16. There are less routes on R1, so that takes up the less resources on the router.

 

The other benefit you get from this is let's say that the 10.0.0.0/24 link goes down. All of my other routers that are in Area 1 will have to re-converge, see if they can find a better path to get there. So R3 and R4 will have to recalculate. It'll have to do work to update their routing table, about the 10.0.0.0/24 network going down.

 

But if you look at it from the point of view of R1, well, its summary route still stays the same. If any of these individual routes here go down, our 10.0.0.0/16 route is still good. If we have an outage in a different area, it doesn't affect the routers that are in this area. That’s why we want to have multi-areas when we've got larger networks.

 

Inter Area Routes

 

When we look in the routing table, our inter-area routes, a route that was learned from an ABR which is in another area will show up as type OIA for inter-area routes. In the example below, I've got a couple of intra-area routes, the bottom two destinations are within the same area as this router.

 

I've got an inter-area route which is in another area, and inter-area routes are always learned from an ABR. They're the border between our areas and where we do our summarization.

 

Inter Area Routes

 

OSPF Router Types – Normal Area Routers

 

The next type of router is a normal area router. This is a router where all of its interfaces are just in one normal area. You can see highlighted in red on the left, I've got three routers which are Area 1 routers, all of their interfaces in Area 1. I've got an Area 2 router over here on the right.

 

OSPF Router Types – Normal Area Routers

 

Again, these routers will maintain the full link-state database for the areas in which they're a member. All the Area 1 routers will have the full LSDB for Area 1, they will have summary routes for Area 0 and Area 2 that they learned from the ABR. Our Area 2 router will have the full LSDB for Area 2, summary routes for Area 1 and Area 0.

 

OSPF Router Types – Normal Area Routers 1

 

OSPF Router Types - ASBRs

 

Our last type of router is an ASBR, an Autonomous System Boundary Router. ABR is an Area Border Router, ASBR is Autonomous System Boundary Router. What an ASBR is, means that on that router, it's running OSPF, and we're redistributing from another source into OSPF.

 

Maybe we're also running EIGRP or RIP on that router. We're taking our EIGRP or RIP routes, and we're redistributing them into OSPF, so they'll also be advertised to our ORPF neighbors. Or maybe it's a static route that we're redistributing into OSPF. So again, with ASBR, we're redistributing into OSPF on that router.

 

OSPF Router Types - ASBRs

 

External Routes

 

Our redistributed routes show up as external routes. An external route does not mean it's outside this enterprise, outside this organization, it literally means it was redistributed into OSPF.

 

If you look in the routing table, this will show up as a type OE, either E1 or E2 for an external route. So where it says O, it means it an intra-area route, the destination's in the same area. IA is an inter-area route, it's from another area learned by an ABR. E2 means it was redistributed into OSPF.

 

External Routes

 

Cisco OSPF Areas Configuration Example

 

This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.

 

Click here to download your free Cisco CCNA Lab Guide.

 

YouTube Video

 

Cisco OSPF Areas Configuration Example

 

    1. Convert the network to use multi-area OSPF. R3 and R4 should be backbone routers, R1 a normal router in Area 1, and R2 and R5 ABRs as shown in the diagram.

 

Save your changes to the startup config and reboot the routers to ensure the changes take effect.

R3 and R4 require no change as all their interfaces are already in Area 0.

R1’s interfaces need to be reconfigured to be in Area 1 rather than Area 0.

 

R1#show run | section ospf

 ip ospf cost 1500

router ospf 1

 log-adjacency-changes

 auto-cost reference-bandwidth 100000

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.0.0 0.0.0.255 area 0

 

R1(config)#router ospf 1

R1(config-router)#network 10.0.0.0 0.255.255.255 area 1

R1(config-router)#network 192.168.0.0 0.0.0.255 area 1

R1#copy run start

R1#reload

 

R2 interface FastEthernet 0/1 should remain in Area 0. FastEthernet 0/0 needs to be reconfigured to be in Area 1. I used a 10.0.0.0/8 network statement originally so I need to remove that and add more granular statements.

 

R2#sh run | section ospf

router ospf 1

 log-adjacency-changes

 auto-cost reference-bandwidth 100000

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.0.0 0.0.0.255 area 0

 

R2(config)#router ospf 1

R2(config-router)#no network 10.0.0.0 0.255.255.255 area 0

R2(config-router)#network 10.1.0.0 0.0.0.255 area 0

R2(config-router)#network 10.0.0.0 0.0.0.255 area 1

R2#copy run start

R2#reload

 

R5 interface FastEthernet 0/0 should remain in Area 0. FastEthernet 0/1 needs to be reconfigured to be in Area 1.

 

R5#sh run | section ospf

 ip ospf cost 1500

 ip ospf cost 1500

router ospf 1

 log-adjacency-changes

 auto-cost reference-bandwidth 100000

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.0.0 0.0.0.255 area 0

 

R5(config)#router ospf 1

R5(config-router)#no network 10.0.0.0 0.255.255.255 area 0

R5(config-router)#network 10.1.3.0 0.0.0.255 area 0

R5(config-router)#network 10.0.3.0 0.0.0.255 area 1

R5#copy run start

R5#reload

 

2. Verify the router’s interfaces are in the correct areas.

R2#show ip ospf interface

Loopback0 is up, line protocol is up

 Internet address is 192.168.0.2/32, Area 0

FastEthernet0/1 is up, line protocol is up

 Internet address is 10.1.0.2/24, Area 0

FastEthernet0/0 is up, line protocol is up

 Internet address is 10.0.0.2/24, Area 1

! Output truncated

 

3. Verify routers R1 to R5 have formed adjacencies with each other.

R1#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface

192.168.0.5       1   FULL/DR        00:00:33    10.0.3.2        FastEthernet1/1

192.168.0.2       1   FULL/DR        00:00:31    10.0.0.2        FastEthernet0/0

 

4. What change do you expect to see on R1’s routing table? Verify this (give the routing table a few seconds to converge).

The networks beyond R2 and R5 will appear as Inter Area routes (apart from the default route which will appear as an external route as it was redistributed into OSPF).

 

R1#sh ip route

Codes: L - local, 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, H - NHRP, l - LISP

       + - replicated route, % - next hop override

 

Gateway of last resort is 10.0.0.2 to network 0.0.0.0

 

10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks

C 10.0.0.0/24 is directly connected, FastEthernet0/0

L 10.0.0.1/32 is directly connected, FastEthernet0/0

C 10.0.1.0/24 is directly connected, FastEthernet0/1

L 10.0.1.1/32 is directly connected, FastEthernet0/1

C 10.0.2.0/24 is directly connected, FastEthernet1/0

L 10.0.2.1/32 is directly connected, FastEthernet1/0

C 10.0.3.0/24 is directly connected, FastEthernet1/1

L 10.0.3.1/32 is directly connected, FastEthernet1/1

O IA 10.1.0.0/24 [110/2000] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 10.1.1.0/24 [110/3000] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 10.1.2.0/24 [110/4000] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 10.1.3.0/24 [110/4500] via 10.0.0.2, 00:02:59, FastEthernet0/0

192.168.0.0/32 is subnetted, 5 subnets

C 192.168.0.1/32 is directly connected, Loopback0

O IA 192.168.0.2/32 [110/1012] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 192.168.0.3/32 [110/2012] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 192.168.0.4/32 [110/3012] via 10.0.0.2, 00:03:10, FastEthernet0/0

O IA 192.168.0.5/32 [110/4512] via 10.0.0.2, 00:02:59, FastEthernet0/0

O IA 203.0.113.0/24 [110/3001] via 10.0.0.2, 00:03:10, FastEthernet0/0

O*E2 0.0.0.0/0 [110/1] via 10.0.0.2, 00:02:59, FastEthernet0/0

 

5. Do you see less routes in R1’s routing table? Why or why not?

R1 has the same amount of routes in its routing table because OSPF does not perform automatic summarisation. You must configure manual summarisation to reduce the size of the routing table.

 

6. Configure summary routes on the Area Border Routers for the 10.0.0.0/16 and 10.1.0.0/16 networks.

R2(config)#router ospf 1

R2(config-router)#area 0 range 10.1.0.0 255.255.0.0

R2(config-router)#area 1 range 10.0.0.0 255.255.0.0

 

R5(config-if)#router ospf 1

R5(config-router)#area 0 range 10.1.0.0 255.255.0.0

R5(config-router)#area 1 range 10.0.0.0 255.255.0.0

 

7. Verify R1 now sees a single summary route for 10.1.0.0/16 rather than individual routes for the 10.1.x.x networks.

R1#sh ip route

Codes: L - local, 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, H - NHRP, l - LISP

       + - replicated route, % - next hop override

 

Gateway of last resort is 10.0.0.2 to network 0.0.0.0

 

10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks

C 10.0.0.0/24 is directly connected, FastEthernet0/0

L 10.0.0.1/32 is directly connected, FastEthernet0/0

C 10.0.1.0/24 is directly connected, FastEthernet0/1

L 10.0.1.1/32 is directly connected, FastEthernet0/1

C 10.0.2.0/24 is directly connected, FastEthernet1/0

L 10.0.2.1/32 is directly connected, FastEthernet1/0

C 10.0.3.0/24 is directly connected, FastEthernet1/1

L 10.0.3.1/32 is directly connected, FastEthernet1/1

O IA 10.1.0.0/16 [110/2000] via 10.0.0.2, 00:00:04, FastEthernet0/0

192.168.0.0/32 is subnetted, 5 subnets

C 192.168.0.1/32 is directly connected, Loopback0

O IA 192.168.0.2/32 [110/1012] via 10.0.0.2, 00:05:27, FastEthernet0/0

O IA 192.168.0.3/32 [110/2012] via 10.0.0.2, 00:05:27, FastEthernet0/0

O IA 192.168.0.4/32 [110/3012] via 10.0.0.2, 00:05:27, FastEthernet0/0

O IA 192.168.0.5/32 [110/4512] via 10.0.0.2, 00:05:16, FastEthernet0/0

O IA 203.0.113.0/24 [110/3001] via 10.0.0.2, 00:05:27, FastEthernet0/0

O*E2 0.0.0.0/0 [110/1] via 10.0.0.2, 00:05:16, FastEthernet0/0

 

8. Verify R1 is receiving a summary route for the 10.1.0.0/16 network from both R2 and R5.

R1#sh ip ospf database

 

            OSPF Router with ID (192.168.0.1) (Process ID 1)

 

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count

192.168.0.1     192.168.0.1     18          0x80000005 0x00536E 5

192.168.0.2     192.168.0.2     27          0x80000003 0x0069ED 1

192.168.0.5     192.168.0.5     1890        0x80000003 0x00C490 1

 

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

10.0.0.1        192.168.0.1     18          0x80000002 0x00DF0E

10.0.3.1        192.168.0.1     18          0x80000002 0x00E8FE

 

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.0.5     192.168.0.5     408         0x80000006 0x00e987

10.0.3.0        192.168.0.5     408         0x80000007 0x007e7d

192.168.0.4     192.168.0.5     408         0x80000009 0x00bbd1

203.0.113.0     192.168.0.5     408         0x8000000a 0x00ebdb

192.168.0.3     192.168.0.5     408         0x8000000b 0x00f4ab

192.168.0.2     192.168.0.5     408         0x8000000c 0x003084

10.0.0.0        192.168.0.5     408         0x8000000d 0x002c09

192.168.0.2     192.168.0.2     1079        0x80000005 0x001c5c

192.168.0.3     192.168.0.2     1079        0x80000006 0x004446

192.168.0.4     192.168.0.2     1079        0x80000008 0x006932

203.0.113.0     192.168.0.2     1079        0x80000009 0x00993c

192.168.0.5     192.168.0.2     398         0x80000006 0x00308a

10.0.3.0        192.168.0.2     398         0x80000007 0x00c282

192.168.0.1     192.168.0.5     393         0x80000010 0x003c74

10.1.0.0        192.168.0.5     82         0x80000015 0x007679

10.1.0.0        192.168.0.2     67          0x8000001f 0x000ee4

 

                Summary ASB Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.0.4     192.168.0.2     27          0x80000002 0x00EE9B

192.168.0.4     192.168.0.5     1889        0x80000002 0x00433A

 

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag

0.0.0.0         192.168.0.4     207         0x80000002 0x00152F 1

 

9. R1 is routing traffic to 10.1.0.0/16 via R2 only. Why is it not load balancing the traffic through both R2 and R5?

We configured the link from R1 to R5 to have a higher cost than the link from R1 to R2 earlier.

 

R1#sh run | begin interface FastEthernet1/1

Building configuration...

 

Current configuration : 100 bytes

!

interface FastEthernet1/1

 ip address 10.0.3.1 255.255.255.0

 ip ospf cost 1500

 

Additional Resources

 

What Are OSPF Areas and Virtual Links?: https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/13703-8.html

OSPF with Multi-Area Adjacency Configuration Example: https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/118879-configure-ospf-00.html

IP Routing: OSPF Configuration Guide: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_ospf/configuration/xe-16/iro-xe-16-book/iro-cfg.html

 

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

 

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

Libby’s passion for technology drives her to constantly learn and share her insights with others. When she’s not immersed in the world of tech, you’ll find her lost in a good book with a cup of coffee or out exploring nature on her next adventure—always curious, always inspired.