From owner-freebsd-net@FreeBSD.ORG Tue Jun 20 21:26:51 2006 Return-Path: X-Original-To: net@freebsd.org 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 16C0E16A494 for ; Tue, 20 Jun 2006 21:26:51 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1263343D7F for ; Tue, 20 Jun 2006 21:26:50 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id k5KLQl9E001395; Tue, 20 Jun 2006 14:26:47 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id k5KLQl0X001394; Tue, 20 Jun 2006 14:26:47 -0700 (PDT) (envelope-from rizzo) Date: Tue, 20 Jun 2006 14:26:47 -0700 From: Luigi Rizzo To: Brett Glass Message-ID: <20060620142647.A1333@xorpc.icir.org> References: <7.0.1.0.2.20060620143845.06662330@lariat.org> <20060620205730.GC3968@catpipe.net> <20060620140722.A1192@xorpc.icir.org> <7.0.1.0.2.20060620151013.042be3f8@lariat.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <7.0.1.0.2.20060620151013.042be3f8@lariat.org>; from brett@lariat.org on Tue, Jun 20, 2006 at 03:22:46PM -0600 Cc: net@freebsd.org Subject: Re: Best way to block a long list of IPs? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2006 21:26:51 -0000 On Tue, Jun 20, 2006 at 03:22:46PM -0600, Brett Glass wrote: > At 03:07 PM 6/20/2006, Luigi Rizzo wrote: > > >there are efficient tables in ipfw as well, which Ruslan implemented > >some time ago -- yet another reason we should be grateful to him > > How would I build a table of arbitrary IP addresses and be able > to update it atomically (i.e. add and delete individual addresses > and not lose all filtering when there was a modification)? please have a look at the ipfw manpage, the relevant commands are ipfw table number add addr[/masklen] [value] ipfw table number delete addr[/masklen] and the matching is as fast as a route lookup as it uses the same type of data structure. cheers luigi