The Great Null0
As I am studying for my CCNP exam I came across a good link explaining the advantages of using Null0 interface.
The basic use of Null0 interface is you prevent routing loops…Read here.
Ok firstly an example of routing loops.
take 2 networks, simple routing table
10.1.1.0/24 –> via 172.16.0.1
10.2.2.0/24 –> via 172.16.0.1
10.0.0.0/8 –> via null0
The summary route at the classful boundry in 10.0.0.0/8 routes from 10.1.1.0/8 and 10.2.2.0/8 will always take the /24 routes – because of the longest match rule
Now if the router sees traffic coming from 10.3.3.0/24, it will not match networks 10.1.1.0/24 or 10.2.2.0/24 as they have a specific entry saying go from 172.16.0.0.
For 10.3.3.0/24 instead will take it through the 10.0.0.0/8 as it does not match a longer specific route as the .1 and .2 networks. So the .3 networks goes through the 10.0.0.0/8 route which points to null0 and since the network doesn’t know anything about 10.3.3.0/24 network it drops the traffic.
If the Null0 router was not in there as it was then your default route would pass on the traffic and the packets would bounce around between links(Hence the routing loop so to speak) until their TTL expires.
In addition you could use it to stop ip spoofing on you network by using the command:
Interface null0
no ip unreachable
The definition of ip unreachable is as follows:
Use the ip unreachables command to enable the router to send an ICMP unreachable message to the source if the router receives a packet that has an unrecognized protocol or no route to the destination address.
Use the no ip unreachables command to disable sending ICMP unreachable messages.
So as you can see if you do not want to reply to anyone trying to spoofing your network use the above command.
Oh also while we’r on this topic of Null0 you might as well use the following to stop all your internal IP’s from routing. Also you may want to add bogons to this list. Why do it with a static route to Null0 to stop these you say? Well sure you can do it with ACL as well. But doing it this way saves on CPU cycles.
ip classless
ip route 10.0.0.0 255.0.0.0 Null0
ip route 127.0.0.0 255.0.0.0 Null0
ip route 172.16.0.0 255.240.0.0 Null0
ip route 192.168.0.0 255.255.0.0 Null0