route how to?

Charles Swiger cswiger at mac.com
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 192.168.10.1 <http://192.168.10.1> 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 192.168.10.1 localhost -reject

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

route delete 192.168.10.1

-- 
-Chuck



More information about the freebsd-questions mailing list