Kudithipudi.Org Too much time on hand!!!

March 26, 2012

HOW TO : Route traffic to loopback interface in Linux

Filed under: HOWTO,Linux,Networking — Vinay @ 11:02 pm

Back in 2009 (last decade!! :) ), I wrote a blog post on how you can trick windows to route traffic destined to a particular IP address to a black-hole. In it, I mentioned the command to route traffic to /dev/null in Linux was


I ran into a need to try it today and looks like the trick doesn’t work :). So here is the right command if you want to route traffic to the loopback (or blackhole) destined to a particular IP address

sudo route add -host IP_ADDRESS_OF_HOST/NETWORK_MASK lo 

For example if I want to black-hole traffic destined to, I would do the following

 sudo route add -host lo 

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress