What is the use of null0 interface? How to configure it?

If a static route is configured for the network to the null0 interface, the packets will be dropped without the ICMP message or without having to configure an access list to block/deny traffic. This interface is always up and can never forward or receive traffic and any encapsulation will always fail. The null interface provides an alternative method of filtering traffic. You can escape the overhead involved with using access lists by directing undesired network traffic to the null interface.

The Null interface is typically used for preventing routing loops. Enhanced Interior Gateway Routing Protocol (EIGRP), for instance, always creates a route to the Null0 interface when it summarizes a group of routes. Whenever a routing protocol summarizes, this means that the router might receive traffic for any IP address within that summary. Because not all IP addresses are always in use, there is a risk of looping packets in case default routes are used on the router which receives the traffic for the summary.

When you configure summarization in OSPF ABR and ASBR generate the summary routes, but they aren’t real routes, so it simply points them to its Null0 interface called discard routes.

R1#configure terminal
R1(config)#interface null0
R1(config-if)#ip unreachable