Fun (?!) with Cisco OSPF part 1

There are several factors involved in successfully forming an OSPF neighbourship, these are:

  1. Must pass the authentication process
  2. Must be in the same subnet with a matching mask
  3. Must be in the same OSPF area
  4. Stub flag must match
  5. Unique router-id required
  6. Dead and hello timers must match

This post really just refers to item 3 – the OSPF area. In the past I have come across routers set in area 0.0.0.0 while being neighbours of routers in area 0. This always struck me as weird but I had assumed it was an old IOS thing and pushed it to the back of my mind! It seems however that the area ID can be entered in either decimal or dotted quad notation, more interestingly they are interoperable! Here is the configuration in standard format:

router ospf 1
 log-adjacency-changes
 network 10.1.0.4 0.0.0.0 area 456

All pretty standard, but the neighbour is configured thus:

router ospf 1
 log-adjacency-changes
 network 10.1.0.5 0.0.0.0 area 0.0.1.200

Interesting huh? How does 0.0.1.200 become 456? Well, the dotted quad format should be treated as 32 bit single binary number so in full binary it would be:

0000 0000 0000 0000 0000 0001 1100 1000

When you take into account that the router shows this when we use the question mark after the ‘area’ part of the command:

R5(config-router)#network 1.1.1.1 0.0.0.0 area ?
  <0-4294967295>  OSPF area ID as a decimal value
  A.B.C.D         OSPF area ID in IP address format

And as you would predict, the binary number 1111 1111 1111 1111 1111 1111 1111 1111 is equal to 4294967295 or, should you want to enter the area in dotted quad format, it is of course 255.255.255.255

It’s not possible to mix up the formats on the same router, it seems that once an area has been defined in dotted quad format, there it must stay, see this example:

R4(config)#router ospf 1
R4(config-router)#network 4.4.4.4 0.0.0.0 area 255.255.255.255 
R4(config-router)#area 4294967295 stub
R4(config-router)#exit
R4#sh run | s ospf
router ospf 1
 log-adjacency-changes
 area 255.255.255.255 stub
 network 4.4.4.4 0.0.0.0 area 255.255.255.255

But I suppose that would have been VERY confusing!

This entry was posted in Cisco and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *