Apr 232012
 

The Null0 interface is used to drop packets. Often routes to Null0 interfaces are generated as part of summarization in order to avoid routing loops.

Let’s assume the following situation:

R1 has a default route towards R2. R2 and R3 has a summary route for 10.0.0.0/22 towards R1. R3 has also a route to 10.0.12.0/24 pointing to R2.

R1 losses connectivity to the network 10.0.0.0/24. In this case if R2 receives a packet for the ip 10.0.0.1. The packet will be forwarded to R1 because of the summarized route. Then R1 will check for an entry in its RIB and that only match the default route to R2 because the interface is down.

So now the packet loops between the routers.

To simulate this the interface loopback 0 on R1 is shutdown. Then a trace route will show that the packet loops between R1 and R2.

R3#trace 10.0.0.1

Type escape sequence to abort.
Tracing the route to 10.0.0.1

  1 10.0.23.2 28 msec 12 msec 16 msec
  2 10.0.12.1 52 msec 40 msec 20 msec
  3 10.0.12.2 20 msec 36 msec 16 msec
  4 10.0.12.1 72 msec 28 msec 72 msec
  5 10.0.12.2 40 msec 44 msec 52 msec
  6 10.0.12.1 64 msec 88 msec 68 msec
  7 10.0.12.2 88 msec 72 msec 88 msec
  8 10.0.12.1 88 msec 112 msec 84 msec
  9 10.0.12.2 96 msec 96 msec 84 msec
 10 10.0.12.1 116 msec 104 msec 132 msec
 11 10.0.12.2 92 msec 132 msec 132 msec
 12 10.0.12.1 116 msec 144 msec 120 msec
 13 10.0.12.2 136 msec 160 msec 124 msec
 14 10.0.12.1 168 msec 148 msec 168 msec
 15 10.0.12.2 144 msec 144 msec 176 msec
 16 10.0.12.1 192 msec 180 msec 176 msec
 17 10.0.12.2 180 msec 168 msec 188 msec
 18 10.0.12.1 204 msec 184 msec 216 msec
 19 10.0.12.2 192 msec 224 msec 188 msec
 20 10.0.12.1 240 msec 208 msec 244 msec
 21 10.0.12.2 224 msec 208 msec 236 msec
 22 10.0.12.1 244 msec 232 msec 256 msec
 23 10.0.12.2 252 msec 224 msec 244 msec
 24 10.0.12.1 292 msec 244 msec 264 msec
 25 10.0.12.2 268 msec 268 msec 248 msec
 26 10.0.12.1 296 msec 268 msec 280 msec
 27 10.0.12.2 292 msec 292 msec 292 msec
 28 10.0.12.1 292 msec 324 msec 312 msec
 29 10.0.12.2 280 msec 296 msec 332 msec
 30 10.0.12.1 324 msec 320 msec 324 msec

This could be solved by configuring a summary route also on R1 but pointing to null 0 interface.
R1(config)#ip route 10.0.0.0 255.255.252.0 null 0

Due to the summary route on R1, it wont use the default route to sent the packet to R2.