OSPF without Area 0: Understanding OSPF Routing in Multi-Area Networks

Introduction

OSPF is a hierarchical routing protocol. Hence everything between different areas should pass through area 0. Areas are defined as logical grouping of ospf router’s interface in a single routing domain. Area 0 is considered to be the backbone area and two different areas(e.g 1 and 2) will exchange routes only if they are connected by area 0.

Hence normal ospf architecture looks like this:

But what will happen if you are not having ospf area 0 in between. You can have OSPF authentication enabled between these routers but for simplicity we have considered that there is no authentication configured between these routers. Will you receive the routing update but packet won’t travel or won’t you receive any routing update at all? So I have made a little change and have connected the ospf routers as shown below:

Please find below the relevant configuration from all the three routers:

R1#

interface Loopback0
ip address 1.1.1.1 255.255.255.255
no clns route-cache
interface FastEthernet1/0
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
no clns route-cache

router ospf 1

 log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 1
network 10.0.0.0 0.0.0.255 area 1

R2#

interface Loopback2
ip address 2.2.2.2 255.255.255.255
no clns route-cache
!
interface FastEthernet1/0
ip address 10.0.0.2 255.255.255.0
duplex auto
speed auto
no clns route-cache
 log-adjacency-changes
network 10.0.0.0 0.0.0.255 area 1
network 20.0.0.0 0.0.0.255 area 2

R3#

interface Loopback1
ip address 3.3.3.3 255.255.255.255
no clns route-cache
interface FastEthernet1/0
 ip address 20.0.0.2 255.255.255.0
duplex auto
speed auto
no clns route-cache
router ospf 1
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 2
network 20.0.0.0 0.0.0.255 area 2

Just to make sure that all the adjacencies have formed:

R2#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
 1.1.1.1           1   FULL/BDR        00:00:38    10.0.0.1        FastEthernet1/0
 3.3.3.3           1   FULL/DR         00:00:37    20.0.0.2        FastEthernet1/1

Lets check the routes on both the end routers:

R1#  sh 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, E - EGP
  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

 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.0.0.0 is directly connected, FastEthernet1/0
R3#  sh 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, E - EGP
  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

 3.0.0.0/32 is subnetted, 1 subnets
 C       3.3.3.3 is directly connected, Loopback1
  20.0.0.0/24 is subnetted, 1 subnets
 C       20.0.0.0 is directly connected, FastEthernet1/0

So it is confirmed now, if you are not having ospf area 0 is trnasit, routers in different areas won’t be able to exchange routes.

Now lets configure area 0 in R2:

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#network 40.0.0.0 0.0.0.255 area 0

But something has gone wrong I am still not receiving inter area routes. I have configured Area 0 on R2 but why the routers are still not exchanging the routes? Remember I have not configured the IP address range 40.0.0.0/24 to any of the interface. OSPF network command means that run ospf instance on the interface which are in range defined by network statement. Hence interface has to be up for R2 to be considered as part of area 0. So in order to advertise routes to each other I have configured 40.0.0.1/24 to one of the loopbacks on R2 and R1 and R2 has started exchanging routes.

R3#sh ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/3] via 20.0.0.1, 00:00:01, FastEthernet1/0
40.0.0.0/32 is subnetted, 1 subnets
O IA    40.0.0.1 [110/2] via 20.0.0.1, 00:00:01, FastEthernet1/0
10.0.0.0/24 is subnetted, 1 subnets
O IA    10.0.0.0 [110/2] via 20.0.0.1, 00:00:01, FastEthernet1/0

And ping also works:

R3#ping 1.1.1.1

Type escape sequence to abort.
 Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
 !!!!!
 Success rate is 100 percent (5/5), round-trip min/avg/max = 32/72/160 ms

Conclusion

Hence to summarize, for route transfer between 2 different areas of ospf, it is mandatory that routing update has to pass through the backbone area. But it is not mandatory that it passes between 2 area 0 routers. If you are having 2 different area routers connected to one area 0 ABR, it will still work.

Leave a Comment