Difference between null and actual interface in static routes

Unanswered Question
Aug 8th, 2007

Hi all,

I have a doubt in the below cisco document :


In the first scenario "OSPF Has a Longer Mask Than RIP", they have added static route with null0

But, in the second scenario "RIP Has a Longer Mask Than OSPF", they have added static route with actual interfaces.

Can someone explain me why is it needed ? (elaborately)



I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Jon Marshall Wed, 08/08/2007 - 07:07

Hi Vijaybabu

The reasoning is all to do with the length of the masks.

In the first example

RIP will not advertise OSPF routes because the OSPF routes have a longer subnet mask even though they are on the same major network.

So you add a route to the OSPF network pointing to Null0 and redistribute into RIP.

This works because GW-2 will now receive any packets for the from the RIP domain. If it has a more specific route for the subnet it will then forward that packet on into the OSPF domain. If it doesn't it will just route it to Null0 ie. drop the packet.

In the second example it is the other way round ie. RIP has a longer mask than OSPF.

Now lets take one of the ip routes they add as an example.

ip route E0/0

If we changed that to be

ip route Null0

then it wouldn't work. It wouldn't work because a packet from the RIP domain needs to be routed to

The packet arrives at GW-2. The router has an entry for but it also has a more specific entry that points to Null0 ie. Null0

so GW-2 would drop the packet. This is why you cannot use Null0 in these route statements.

Hope this makes sense


Pavel Bykov Wed, 08/08/2007 - 07:23

Static with NULL:

In this case you needed to somehow advertise network. You cannot point this network to any of the interfaces, since interface has longer mask. Pointing to NULL achieves that packet arrives at the router. Router then uses longest prefix match, and chooses other interface than NULL to route packets. Only in case that interfaces would be down, would packets be routed to NULL (i.e. dropped. But then, they would be dropped anyway since there would be no route to destination)

In second case, you can point longer prefix static to interface with shorter prefix interface. Also, if you would point those routes to NULL, because they are better routes than interfaces themselves (longer prefix), all packets would get routed to NULL (i.e. dropped).


This Discussion