cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
518
Views
9
Helpful
3
Replies

Difference between null and actual interface in static routes

GillieLucent
Level 1
Level 1

Hi all,

I have a doubt in the below cisco document :

http://cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080093fd9.shtml

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)

Thanks,

Vijaybabu

3 Replies 3

Jon Marshall
Hall of Fame
Hall of Fame

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 128.103.35.0 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 128.103.35.32 255.255.255.248 E0/0

If we changed that to be

ip route 128.103.35.32 255.255.255.248 Null0

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

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

128.103.35.32 255.255.255.248 Null0

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

Hope this makes sense

Jon

Hi Jon,

Thanks for the great explanation.

Thanks,

Vijaybabu

Pavel Bykov
Level 5
Level 5

Static with NULL:

In this case you needed to somehow advertise 128.103.35.0/24 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).

Review Cisco Networking for a $25 gift card