From owner-freebsd-net@FreeBSD.ORG Thu Jun 26 00:54:07 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 9B6E537B401 for ; Thu, 26 Jun 2003 00:54:07 -0700 (PDT) Received: from mailspool.ops.uunet.co.za (mailspool.ops.uunet.co.za [196.7.0.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06FAD43F3F for ; Thu, 26 Jun 2003 00:54:04 -0700 (PDT) (envelope-from ianf@mci.com) Received: from copernicus.so.cpt1.za.uu.net ([196.30.72.32]) by mailspool.ops.uunet.co.za with esmtp (Exim 3.36 #1) id 19VRZa-0001L4-00; Thu, 26 Jun 2003 09:53:38 +0200 Received: from localhost ([127.0.0.1] helo=mci.com) by copernicus.so.cpt1.za.uu.net with esmtp (Exim 3.36 #1) id 19VRZT-0003PL-00; Thu, 26 Jun 2003 09:53:31 +0200 To: Lars Eggert In-reply-to: Your message of "Tue, 24 Jun 2003 08:48:01 MST." <3EF872B1.20208@isi.edu> References: <3EF872B1.20208@isi.edu> From: Ian Freislich X-image-url: http://www.digs.iafrica.com/gallery/ian-small.gif X-BOFH: true X-LART: Depleted uranium X-No-Junk-Mail: I do not want to get *any* junk mail. You have been deleted Date: Thu, 26 Jun 2003 09:53:31 +0200 Message-ID: <13102.1056614011@mci.com> Sender: ianf@mci.com cc: Adam cc: net@freebsd.org Subject: Re: Bandwidth monitoring 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: Thu, 26 Jun 2003 07:54:07 -0000 Lars Eggert wrote: > Adam wrote: > > My ISP is placing strict restrictions on how much I can transfer each > > month, with high penalties for exceeding their limits. However, they > > don't provide any way for their customer's to check to see how much > > they've transferred, so we end up transferring far less than what we are > > allowed, just to make sure we avoid paying the fines for going over the > > limit. > > > > So, what I need to do is find a way to monitor my total bandwidth > > through my external NIC. My gateway is running FreeBSD 4.8 with > > ipf+ipnat. > > > > I *don't* need anything fancy. All I need is to be able to check at any > > time how much I've transferred since the first of the month. What's the > > easiest way to set up something like this? I know there are fancy > > solutions with graphs with usage stats and such, but that's not what I'm > > after. > > What's wrong with netstat? Won't that count all the ethernet frames and local ethernet broadcasts which probably won't be billed for? We had this problem using router (ethernet) interface counters to measure traffic in our hosting center. The trouble is that any traffic between servers on the same physical network is counted even though it isn't routed and shouldn't be billed for. It's pretty unfair of your ISP to charge you for useage without providing any mechanism for you to keep tabs on what they're measuring throughout the month. I would suggest that you find out exacly how they measure your traffic useage. ie do they measure only packets that were switched by their router or just any and every single byte that their router's ethernet interface sees. The first is IMHO much more fair than the second because trafic local to your IP network won't be charged. I can give you a hand setting up a graph like: http://www.digs.iafrica.com/20030520_00h00-20030620_00h00.gif This is _really_ simple to do and if you have managers, they will really like the green changes to red when you go over the limit. Ian