In the first part of the article, we began talking about LSA types and area types.

In the second part we will configure our network to support all OSPF area types that we discussed previously.

We will use the topology below for configuration and verification:

Each router has a loopback interface following this address scheme: Rx=x.x.x.x/32. For instance, R1 has a loopback interface with the IP address 1.1.1.1/32.

  • Area 0 is the backbone area.
  • Area 1 is a normal area, non-backbone area.
  • Area 2 will be a NSSA area.
  • Area 3 will be a stub area.
  • Area 2 and Area 3 will be configured initially as non-backbone areas.

Router R6 is not part of OSPF routing domain. We run RIP protocol between R5 and R6 so that the loopback of R6 will be advertised to R5 and later on be redistributed in OSPF domain by R5.

We already covered how to configure the OSPF protocol to run on specific interfaces and how to configure backbone/non-backbone areas so we won’t spend too much time on that.

As previously mentioned, Area 3 is a stub area. You might remember from the first part of the article that, in the case of stub area, all routers have to configure the areas as stub if they have an interface in those areas, including the ABR.

So let’s see what the configuration of OSPF looks like on R1, which is an internal router:

R1#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 3 stub
 network 1.1.1.1 0.0.0.0 area 3
 network 10.10.12.1 0.0.0.0 area 3
R1#

R2#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 3 stub
 network 2.2.2.2 0.0.0.0 area 0
 network 10.10.12.2 0.0.0.0 area 3
 network 10.10.23.2 0.0.0.0 area 0
R2#

That’s it. To make an area stub, you just have to configure “area X stub” under the OPSF protocol configuration.

Let’s check what the link-state database contains:

R1#show ip ospf database 

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

                Router Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         689         0x80000041 0x00C5CE 2
2.2.2.2         2.2.2.2         690         0x80000041 0x00AAF4 1

                Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.12.2      2.2.2.2         690         0x8000003F 0x00E7DF

                Summary Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         2.2.2.2         698         0x80000001 0x0075C0
2.2.2.2         2.2.2.2         698         0x8000003C 0x00A250
3.3.3.3         2.2.2.2         698         0x8000003C 0x007E6F
4.4.4.4         2.2.2.2         698         0x8000003C 0x005A8E
5.5.5.5         2.2.2.2         238         0x80000001 0x00AC72
7.7.7.7         2.2.2.2         698         0x8000003C 0x00CF0D
10.10.23.0      2.2.2.2         698         0x8000003C 0x0006C9
10.10.34.0      2.2.2.2         699         0x8000003C 0x00962D
10.10.37.0      2.2.2.2         699         0x8000003C 0x00754B
10.10.45.0      2.2.2.2         699         0x8000003C 0x002790
R1#

We have two LSAs Type-2 because we have only two routers participating in Area 3. Because we have only one link between them and the segment is multi-access, which implies that a DR is needed, we have only one LSA Type-2. Also, we have quite a number of LSAs Type-3. Those are describing the loopback interfaces of each router running OSPF (you might have noticed that we don’t have the loopback of R6 because it is not running OSPF) and the links between the routers running OSPF.

As said in the first part, once an area becomes stub, then the ABR generates an additional LSA Type-3, which is the default route.

Whatever is in OSPF link-state database should match what is in the routing table (unless any filtering has been applied):

R1#show  ip route | begin Gateway
Gateway of last resort is 10.10.12.2 to network 0.0.0.0

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/2] via 10.10.12.2, 00:24:58, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/3] via 10.10.12.2, 00:24:58, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/4] via 10.10.12.2, 00:24:58, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/5] via 10.10.12.2, 00:17:29, FastEthernet0/0
     7.0.0.0/32 is subnetted, 1 subnets
O IA    7.7.7.7 [110/4] via 10.10.12.2, 00:24:58, FastEthernet0/0
     10.0.0.0/24 is subnetted, 5 subnets
C       10.10.12.0 is directly connected, FastEthernet0/0
O IA    10.10.23.0 [110/2] via 10.10.12.2, 00:24:58, FastEthernet0/0
O IA    10.10.34.0 [110/3] via 10.10.12.2, 00:24:58, FastEthernet0/0
O IA    10.10.37.0 [110/3] via 10.10.12.2, 00:24:58, FastEthernet0/0
O IA    10.10.45.0 [110/4] via 10.10.12.2, 00:24:59, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 10.10.12.2, 00:24:59, FastEthernet0/0
R1#

So we can reach any loopback interface and the inter-routers’ links.

But how about if we want to shrink the OSPF link-state database and the routing table even more? You should configure Area 3 as totally stubby. When an area is configured as totally stubby or totally not-so-stubby, only the ABR has to be configured with additional commands. This is because only the ABR needs to know that it should filter inter-area LSAs. Of course, putting the same configuration on the internal routers as well it won’t harm, but it might reveal a weakness in your understanding the protocol.

The configuration on R2 should change to:

R2#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 3 stub no-summary
 network 2.2.2.2 0.0.0.0 area 0
 network 10.10.12.2 0.0.0.0 area 3
 network 10.10.23.2 0.0.0.0 area 0
R2#

Now that we did this, let’s check the link-state and the routing table of R1:

R1#show ip ospf database                                    

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

                Router Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         308         0x80000042 0x00C3CF 2
2.2.2.2         2.2.2.2         81          0x80000042 0x00A8F5 1

                Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.12.2      2.2.2.2         81          0x80000040 0x00E5E0

                Summary Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         2.2.2.2         59          0x80000003 0x0071C2
R1#

As you can see, we have everything the same in regard to LSA Type-1 and Type-2. However, we have only one LSA Type-3, which is the default route and the routing table is reflecting this:

R1#show  ip route | begin Gateway
Gateway of last resort is 10.10.12.2 to network 0.0.0.0

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.12.0 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 10.10.12.2, 00:02:07, FastEthernet0/0
R1#

Let’s go and configure Area 2 as NSSA. This is the configuration needed on R4 and R5:

R4#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 2 nssa
 network 4.4.4.4 0.0.0.0 area 0
 network 10.10.34.4 0.0.0.0 area 0
 network 10.10.45.4 0.0.0.0 area 2
R4#

R5#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 2 nssa
 network 5.5.5.5 0.0.0.0 area 2
 network 10.10.45.5 0.0.0.0 area 2
R5#

Again, the configuration change to transform a normal area to a not-so-stubby area is very simple: “area X nssa”. Let’s check the link-state database:

R5#show  ip ospf  database 

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         463         0x80000042 0x00B08C 1
5.5.5.5         5.5.5.5         458         0x80000044 0x008E81 2

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.45.5      5.5.5.5         458         0x80000040 0x0085F0

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
1.1.1.1         4.4.4.4         471         0x80000004 0x00AA71
2.2.2.2         4.4.4.4         471         0x8000003D 0x00FFDF
3.3.3.3         4.4.4.4         471         0x8000003D 0x00C715
4.4.4.4         4.4.4.4         471         0x8000003D 0x008F4A
7.7.7.7         4.4.4.4         471         0x8000003D 0x0019B2
10.10.12.0      4.4.4.4         471         0x8000003D 0x00DCEA
10.10.23.0      4.4.4.4         471         0x8000003D 0x005964
10.10.34.0      4.4.4.4         472         0x8000003D 0x00D5DD
10.10.37.0      4.4.4.4         472         0x8000003D 0x00BEF0
R5#

We have pretty much the same information as in a stub area: the loopback interfaces and IP addresses of all routers running OSPF and the links between the routers. Let’s check the connectivity between the IP address from R1’s loopback interface and the IP address of R5’s loopback interface:

R1#ping 5.5.5.5 source 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/97/116 ms
R1#

One thing is missing from the link-state database in case of a NSSA: the Type-3 LSA used for default route. By default, Cisco is not generating a default route when an area is NSSA.

If you need the default route, you have to configure it.

This is what is needed on the ABR:

R4#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 2 nssa default-information-originate
 network 4.4.4.4 0.0.0.0 area 0
 network 10.10.34.4 0.0.0.0 area 0
 network 10.10.45.4 0.0.0.0 area 2
R4#

Now the routing table will show the default route as “N2”, which means that is a route learned through a LSA Type-7:

R4#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 2 nssa default-information-originate
 network 4.4.4.4 0.0.0.0 area 0
 network 10.10.34.4 0.0.0.0 area 0
 network 10.10.45.4 0.0.0.0 area 2
R4#

Let’s configure Area 2 as a totally not-so-stubby area and remove the default route generation from R4. The change needed on R4 is the following:

R4#show running-config | section ospf
router ospf 1
 log-adjacency-changes
 area 2 nssa no-summary
 network 4.4.4.4 0.0.0.0 area 0
 network 10.10.34.4 0.0.0.0 area 0
 network 10.10.45.4 0.0.0.0 area 2
R4#

Checking the link-state database of R5, we see:

R5#show  ip ospf  database 

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         95          0x80000005 0x002B4F 1
5.5.5.5         5.5.5.5         87          0x80000049 0x008486 2

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.45.5      5.5.5.5         97          0x80000001 0x0004B1

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         4.4.4.4         99          0x80000001 0x00C065
R5#

We can see that all LSA Type-3 were removed, except one of them, which is the default route.

Here is the difference between the two cases when a default route is manually generated (as LSA Type-7) and automatically (as LSA Type-3):

R5#show  ip route | i 0.0.0.0
Gateway of last resort is 10.10.45.4 to network 0.0.0.0
     10.0.0.0/24 is subnetted, 2 subnets
O*IA 0.0.0.0/0 [110/2] via 10.10.45.4, 00:02:48, FastEthernet0/0
R5#

Next, the RIP protocol was configured between R5 and R6. R6 is advertising its loopback IP address and it should be learned by R5:

R5#show  ip route rip
R    6.0.0.0/8 [120/1] via 10.10.56.6, 00:00:02, FastEthernet1/0
R5#

After that, the RIP routes are redistributed in OSPF, in which case they should be learned by R4 as well and all the other routers that are not internal to stub/NSSA areas.

Router R5 is advertising a default route through RIP so that R6 can reach any destination from the OSPF routing domain.

Let’s check what the link-state database on R5 looks like after the RIP was redistributed in OSPF. We should see two LSA Type-7, the loopback IP address of R6 and the link between R5 and R6:

R5#sh ip ospf  database 

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         611         0x80000005 0x002B4F 1
5.5.5.5         5.5.5.5         46          0x8000004A 0x00887F 2

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.45.5      5.5.5.5         613         0x80000001 0x0004B1

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         4.4.4.4         615         0x80000001 0x00C065

                Type-7 AS External Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Tag
6.0.0.0         5.5.5.5         46          0x80000001 0x0069FE 0
10.10.56.0      5.5.5.5         46          0x80000001 0x0052CF 0
R5#

As R4 is in the same area as R5, it should have the same number of LSAs Type-7, originated by R4(4.4.4.4):

R5#sh ip ospf  database 

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         611         0x80000005 0x002B4F 1
5.5.5.5         5.5.5.5         46          0x8000004A 0x00887F 2

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.45.5      5.5.5.5         613         0x80000001 0x0004B1

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         4.4.4.4         615         0x80000001 0x00C065

                Type-7 AS External Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Tag
6.0.0.0         5.5.5.5         46          0x80000001 0x0069FE 0
10.10.56.0      5.5.5.5         46          0x80000001 0x0052CF 0
R5#  

	As R4 is in the same area as R5, it should have the same number of LSAs Type-7, originated by R4(4.4.4.4):

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         601         0x80000005 0x002B4F 1
5.5.5.5         5.5.5.5         38          0x8000004A 0x00887F 2

                Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.45.5      5.5.5.5         605         0x80000001 0x0004B1

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         4.4.4.4         606         0x80000001 0x00C065

                Type-7 AS External Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Tag
6.0.0.0         5.5.5.5         39          0x80000001 0x0069FE 0
10.10.56.0      5.5.5.5         39          0x80000001 0x0052CF 0

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
6.0.0.0         4.4.4.4         32          0x80000001 0x001C5A 0
10.10.56.0      4.4.4.4         32          0x80000001 0x00052B 0
R4#

We can see the same link ID twice, once as LSA Type-7 and once as LSA Typ-5. This is because, R4 as ABR, will convert the two LSAs Type-7 into LSAs Type-5 and advertise them to backbone area.

Let’s check one of these two LSAs on R2 and confirm that the LSA Type-5 was generated by R4:

R2#show  ip ospf  database external 6.0.0.0

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

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 774
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 6.0.0.0 (External Network Number )
  Advertising Router: 4.4.4.4
  LS Seq Number: 80000001
  Checksum: 0x1C5A
  Length: 36
  Network Mask: /8
        Metric Type: 2 (Larger than any link state path)
        TOS: 0 
        Metric: 20 
        Forward Address: 5.5.5.5
        External Route Tag: 0

R2#

As you expect, these LSAs Type-5 won’t be present in area 3 because it’s a totally stubby area.

However, it shouldn’t be any problem to have reachability between R1 and R6:

R1#ping 6.6.6.6 source 1.1.1.1   

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/109/140 ms
R1#

Now that you have reached this point of the article, you should be able to configure all types of OSPF areas and you should also be familiar with how you can check various sections of the OSPF link-state database.

By knowing how you can relate the information found in the link-state database and the routing table, you can predict what one of them would look like without knowing what the other one looks like (in the normal conditions without any filtering/altering of the link-state database).

References:

  1. OSPF and IS-IS: Choosing an IGP for Large-Scale Networks – Jeff Doyle
  2. Routing TCP/IP, Volume I – Jeff Doyle, Jennifer Carroll
  3. RFC 2328(http://www.ietf.org/rfc/rfc2328.txt) – OSPF Version 2