Wednesday, August 3, 2011

Configuring OSPF - Stub Area

In this blogtorial we are going to talk about OSPF Stub Areas. We can use stubby areas to limit the size of the OSPF database and when you have 100s of routers and 1000s of routes this can be very useful. 


We will be using the same topology from my previous blogtorials. So let's get started. 






Objective: To configure Area 1 as a Stub area and see how it affects the routing table of R5. 


Below is the routing table for R5 before we make Area 1 into a stub area. As you can see all E2, IA routes are in the routing table and notice via 10.1.1.4, basically every route has to go to 10.1.1.4 so why not make this a stub area?

R5#sh ip route
<-- output shortened -->
     172.16.0.0/24 is subnetted, 5 subnets
C       172.16.5.0 is directly connected, Loopback0
O E2    172.16.6.0 [110/20] via 10.1.1.4, 00:00:27, FastEthernet1/0
O E2    172.16.1.0 [110/20] via 10.1.1.4, 00:00:27, FastEthernet1/0
O E2    172.16.2.0 [110/20] via 10.1.1.4, 00:00:27, FastEthernet1/0
O E2    172.16.3.0 [110/20] via 10.1.1.4, 00:00:27, FastEthernet1/0
     10.0.0.0/24 is subnetted, 3 subnets
O E2    10.2.2.0 [110/20] via 10.1.1.4, 00:00:27, FastEthernet1/0
C       10.1.1.0 is directly connected, FastEthernet1/0
O IA    10.0.0.0 [110/2] via 10.1.1.4, 00:00:27, FastEthernet1/0

Here is how to configure a stub area.

R5#sh run | sec ospf
router ospf 1
 log-adjacency-changes
 area 1 stub ** This command states that area 1 is a stub area. Remember Area type is one of the criteria which has to match in-order to form OSPF neighbor relationship ** 
 network 10.1.1.0 0.0.0.255 area 1
 network 172.16.5.0 0.0.0.255 area 1

R4# sh run | sec ospf
router ospf 1
 log-adjacency-changes
 area 1 stub ** This command states that area 1 is a stub. Remember Area type is one of the criteria which has to match in-order to form OSPF neighbor relationship ** 
 network 10.0.0.0 0.0.0.255 area 0
 network 10.1.1.0 0.0.0.255 area 1
 network 192.168.1.0 0.0.0.255 area 0

Here is R5 routing table and database information after the changes. 

R5#sh ip route
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.5.0 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.1.0 is directly connected, FastEthernet1/0
O IA    10.0.0.0 [110/2] via 10.1.1.4, 00:12:33, FastEthernet1/0 ** Notice the 10.0.0.0 route -- now if you wanted to get just the default you can specify 'area 1 stub no-summary' which will then only inject a default summary route and Area 1 would be called a 'Totally Stubby Area' ** 
O*IA 0.0.0.0/0 [110/2] via 10.1.1.4, 00:12:33, FastEthernet1/0 

R5#sh ip ospf database

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

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.0.0.4        10.0.0.4        1759        0x8000003F 0x00B207 1
10.1.1.5        10.1.1.5        831         0x8000004B 0x00EEE4 2

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.1.1.4        10.0.0.4        1759        0x80000001 0x00C539

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         10.0.0.4        1842        0x80000001 0x003FF0
10.0.0.0        10.0.0.4        1842        0x80000015 0x00947D

So configuring an OSPF stub area is easy as that 'Area # stub'.

Many more articles to come so stay tuned!! If you like my posts please subscribe!!





No comments:

Post a Comment