Null Routing in FreeBSD

Ok Karl… Null routing – real easy 🙂

If you wanted to null route a single IP (, you would run (as root):

/sbin/route add -blackhole

If you wanted to null route a block of IPs (, then use:

/sbin/route add -net -blackhole

If you would rather generate a “Destination Host Unreachable” ICMP response instead of blackholing the traffic, replace -blackhole with -reject

2 thoughts on “Null Routing in FreeBSD

  1. dan Post author

    Oh and to make them permanent… add them to /etc/rc.local or (preferrably) a script running in /usr/local/etc/rc.d/ 😉

  2. kirgudu


    static_routes=”d1 d2 d3″
    route_d1=”-net -reject”
    route_d2=”-net -reject”
    route_d3=”-net -reject”


Leave a Reply

Your email address will not be published. Required fields are marked *