From owner-freebsd-net@FreeBSD.ORG Thu May 29 18:12:49 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8709C37B404 for ; Thu, 29 May 2003 18:12:49 -0700 (PDT) Received: from web14203.mail.yahoo.com (web14203.mail.yahoo.com [216.136.172.145]) by mx1.FreeBSD.org (Postfix) with SMTP id 1E38243F3F for ; Thu, 29 May 2003 18:12:49 -0700 (PDT) (envelope-from neelnatu@yahoo.com) Message-ID: <20030530011249.96101.qmail@web14203.mail.yahoo.com> Received: from [208.2.250.35] by web14203.mail.yahoo.com via HTTP; Thu, 29 May 2003 18:12:49 PDT Date: Thu, 29 May 2003 18:12:49 -0700 (PDT) From: Neelkanth Natu To: "."@babolo.ru, Paul Chvostek In-Reply-To: <1054246787.649875.6873.nullmailer@cicuta.babolo.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-net@freebsd.org Subject: Re: ipfw rules vs routes to localhost? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2003 01:12:49 -0000 --- .@babolo.ru wrote: > > I'm considering: > > > > ipfw add N deny ip from a.b.c.d to any > > > > vs. > > > > route add -host a.b.c.d localhost > > > > I need to block traffic to a number of IP addresses. I thought I'd use > > ipfw to avoid things like UDP DNS lookups that might come in ant take up > > resources while my system tried to respond, but it's been suggested on > > another list that setting routes to localhost will use less resources. > > Ideally, I'd like to be able to block a few tens of thousands of IPs. > > > > What's the scoop? > ipfw with huge list works slow. > Dont try huge route tables. > > use in kernel: > pseudo-device disc #Discard device (ds0, ds1, etc) > > and > ifconfig ds0 inet 0.0.0.1/32 (or else) > route add -host a.b.c.d 0.0.0.1 > instead of localhost An advantage of using "disc" is that you can monitor interface counters and use tcpdump to see the discarded traffic. A blackhole route to the loopback interface does not offer you this luxury. best Neel __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com