From owner-freebsd-net@FreeBSD.ORG Sun Apr 15 21:49:34 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C43816A401 for ; Sun, 15 Apr 2007 21:49:34 +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 498A913C45E for ; Sun, 15 Apr 2007 21:49:34 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l3FLnOCX039415; Sun, 15 Apr 2007 14:49:24 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l3FLnMTg039414; Sun, 15 Apr 2007 14:49:22 -0700 (PDT) (envelope-from rizzo) Date: Sun, 15 Apr 2007 14:49:22 -0700 From: Luigi Rizzo To: Ivan Voras Message-ID: <20070415144922.A39338@xorpc.icir.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from ivoras@fer.hr on Sun, Apr 15, 2007 at 10:06:37PM +0200 Cc: freebsd-net@freebsd.org Subject: Re: ipfw, keep-state and limit 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: Sun, 15 Apr 2007 21:49:34 -0000 On Sun, Apr 15, 2007 at 10:06:37PM +0200, Ivan Voras wrote: > I think I need to start filtering based on simultaneous connections from > source IP addresses because of some abuse that's apparently going on, > so, as I'm already using ipfw, I tried this: > > # ipfw add 6079 allow tcp from any to me 80 setup keep-state limit > src-addr 10 > > To which ipfw replied: > > ipfw: only one of keep-state andlimit is allowed > > (including the "andlimit" typo). > > What I'm trying to do makes sense to me (and seems straightforward to > implement, at least semantically): allow connections to port 80 with > dynamic keep-state rules for individual clients, but allow only 10 > connections from the same address. Is this a limitation in ipfw? Any > suggestions? if i remember well (the implementation dates back to 2001 or so) you just need to use "limit", as it implicitly installs a dynamic state entry (same as keep-state). cheers luigi