Creating a Null Route (Blackhole Route)
A null route (or blackhole route) is a network route that goes nowhere. Matching packets are dropped or ignored rather than forwarded. The act of using null routes is also called blackhole filtering. In short, A null route is a route that goes to nowhere. The reason for creating a null route is to prevent your system from sending any data to a remote system.
Creating a null route
Null routes are usually created using the `route` command. This works under both Windows and Unix, although the syntax differs.
The example shows the creation of a null route for an entire Class C network:
# route add 193.252.19.0 0.0.0.0
add net 193.252.19.0: Glossary Link gateway 0.0.0.0
We can see the route which this command created using the `netstat -nr` command:
# netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
…
193.252.19 0.0.0.0 UGS 0 0 fxp0
..
The result of this command is that no matter what packets we receive from this network, we will never send any packets to this network in reply. Null routes are useful against spammers and other nasty folks on the Internet.
Nullrouting with iproute2 on Linux:
$ ip route add blackhole 192.168.32.128/32
Nullrouting with ‘route’ on Solaris and BSD:
$ route add -host 10.10.0.1 127.0.0.1 -blackhole
$ route add -net 10.10.64.0/18 127.0.0.1 -blackhole
Routing to the Null0 interface on Cisco IOS:
ip route 192.168.0.0 255.255.0.0 Null0
Windows XP/Vista does not support reject or blackhole arguments via route, thus an unused IP address (e.g. 192.168.32.254) must be used as the target gateway:
route -p ADD 192.168.32.128 MASK 255.255.255.255 192.168.32.254


Recent Comments