route how to?

Charles Swiger cswiger at
Fri Nov 11 17:36:03 GMT 2005

On Nov 11, 2005, at 12:15 PM, Perttu Laine wrote:
> I'd like to add route to my computer so one ip would be forwarded to
> "/dev/null". So all other connections would work normally, but  
> connection to
> for example <> would not work. How  
> can this
> be done? And I propably need same for IPv6 too. I'd like to this  
> with route
> instead of firewall 'cause this is temporary and kernel of that  
> computer
> don't have pf enabled at the moment.

It's better to use a firewall than routing to block traffic, but you  
want to use one of these flags:

      -reject    RTF_REJECT     - emit an ICMP unreachable when matched
      -blackhole RTF_BLACKHOLE  - silently discard pkts (during updates)

Something like:

route add localhost -reject

> Oh. And if I add this route, how can delete it later?

route delete


More information about the freebsd-questions mailing list