Null0 interface

Hello team,

How does creating Null0 interface prevent loops?

Sincerely,
Jugal Modi

Hello Jugal

The Null0 interface can be used within the routing table in order to achieve various goals. You can create a static route that points to the Null0 exit interface. The result is that any packets that match that particular entry in the routing table will simply be dropped. Another term for this is “blackholed”. This is different from traffic simply not being matched in the routing table and being dropped. This traffic is explicitly matched, and then purposefully dropped.

There are various reasons to create such a route pointing to the Null0 interface and one of them is to prevent routing loops, especially when route summarization takes place. Consider the following scenario:

Suppose you have a network with the following subnets:

  • 10.1.1.0/24
  • 10.1.2.0/24
  • 10.1.3.0/24
  • 10.1.4.0/24

These subnets are connected to Router A. You have also configured route summarization on the router such that when they are advertised to Router B, (using a dynamic routing protocol) they are summarized as 10.1.0.0/21. This summary includes all addresses from 10.1.0.0 to 10.1.7.255. Let’s also assume that Router A has a default route pointing to Router B.

Now if some packet arrives at Router B with a destination of 10.1.5.55, due to the summary route, it will be sent to Router A. Router A will receive this, but it has no routes to this destination, so it will send this packet to Router B which is the default route. Router B will send it back and so on, resulting in a routing loop.

By placing the following static route to the Null0 interface, this loop can be avoided:

ip route 10.1.0.1 255.255.255.248 Null0

In other words, if you are performing route summarization, any routes within that summarization that don’t correspond to an actual network, are sent to the Null0 interface to ensure that they are not routed elsewhere using the default route resulting in a routing loop. Does that make sense?

I hope this has been helpful!

Laz