From owner-freebsd-isp Thu Jul 11 8:21:27 2002 Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E28337B400 for ; Thu, 11 Jul 2002 08:21:22 -0700 (PDT) Received: from post.xecu.net (post.xecu.net [216.127.136.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id B69FA43E52 for ; Thu, 11 Jul 2002 08:21:21 -0700 (PDT) (envelope-from andy@xecu.net) Received: from thunder.xecu.net (thunder.xecu.net [216.127.136.208]) by post.xecu.net (Postfix) with ESMTP id E45C34807; Thu, 11 Jul 2002 11:21:15 -0400 (EDT) Received: by thunder.xecu.net (Postfix, from userid 100) id 8133B250FF; Thu, 11 Jul 2002 11:21:11 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by thunder.xecu.net (Postfix) with ESMTP id 79F3F250FC; Thu, 11 Jul 2002 11:21:11 -0400 (EDT) Date: Thu, 11 Jul 2002 11:21:11 -0400 (EDT) From: Andy Dills To: Max Cc: freebsd-isp@freebsd.org Subject: Re: IPFW In-Reply-To: <001d01c22800$fc3073a0$04ef10ac@wireless> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 10 Jul 2002, Max wrote: > Hi, > > How do I get IPFW (bandwidth limiting function) to work with logging for > later analysis, like determining bandwidth usage per ip? > > For example, I put an entire ip block in a 256K queue and I want to > check what each member of that block used... Hope the idea is > communicated... > > ${fwcmd} add queue 1 ip from [MY IP BLOCK] to any > ${fwcmd} pipe 10 config bw 256kbit/s > ${fwcmd} queue 1 config pipe 1 weight 30 mask src-ip 0x000000ff To get accounting stats with ipfw, you'd need to add two rules for each IP, prior to the queue, such as: ${fwcmd} add allow ip from any to [IP] count ${fwcmd} add allow ip from [IP] to any count Then, the byte count corresponding with the first rule accounts for how much ingress bandwidth is used, and the byte count for the second rule accounts for how much egress bandwidth is used. Remember to check your stats daily! Store and reset daily, lest you lose important billing data. Andy xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Andy Dills 301-682-9972 Xecunet, LLC www.xecu.net xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Dialup * Webhosting * E-Commerce * High-Speed Access To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message