From owner-freebsd-questions@FreeBSD.ORG Wed Apr 15 14:07:51 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CE18106564A for ; Wed, 15 Apr 2009 14:07:51 +0000 (UTC) (envelope-from office@pc-service.ch) Received: from mail1.hostpark.net (mail1.hostpark.net [212.243.197.31]) by mx1.freebsd.org (Postfix) with ESMTP id C32538FC13 for ; Wed, 15 Apr 2009 14:07:50 +0000 (UTC) (envelope-from office@pc-service.ch) Received: from localhost (localhost [127.0.0.1]) by mail1.hostpark.net (Postfix) with ESMTP id 4A15482D31; Wed, 15 Apr 2009 15:42:13 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail1.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id dtSHo0x13D1G; Wed, 15 Apr 2009 15:42:12 +0200 (CEST) Received: from [192.168.10.161] (unknown [193.5.4.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail1.hostpark.net (Postfix) with ESMTP id 950D882BFF; Wed, 15 Apr 2009 15:42:12 +0200 (CEST) Message-ID: <49E5E434.5000100@pc-service.ch> Date: Wed, 15 Apr 2009 15:42:12 +0200 From: Martin Schweizer Organization: PC-Service M. Schweizer GmbH User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Wojciech Puchar References: <20090405085834.GL72129@saturn.pcs.ms> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: ipfw: bandwidth limiting X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2009 14:07:51 -0000 Hello Wojciech Sorry for the delay but in the past I was very busy. I use now the folowing: $ipfwcmd pipe 1 config bw 80kByte/s $ipfwcmd add pipe 1 ip from any to 192.168.10.0/24{100-254} via em1 $ipfwcmd queue 1 config pipe 1 weight 1 mask dst-ip 0xffffffff $ipfwcmd add queue 1 all from any to 192.168.10.0/24{100-254} via em1 I expect that all hosts are targed with the ip address 192.168.10.0/24, from .100 to .254. Is that correct? As far as I can see it works like expected but I'm not 100% sure. I'm right? Kind regards, Wojciech Puchar schrieb: >> [snip] >> $ipfwcmd pipe 1 config bw 80KByte/s >> $ipfwcmd add pipe 1 ip from any to 192.168.10.0/24{100-254} via em1 >> [snip] >> >> I'm not sure it works. When I do a large download which takes long and >> anybody else want download too, this download will only get a reduce >> bandwidth. I expect that the second download get same rate as the >> first one >> (and reduce the bandwidth from the first one). Is that correct? > > your example limits it all to 80kB/s but does no traffic management. so > it may get the same rate (half by half) or may not. > > > do > > $ipfwcmd pipe 1 config bw 80kByte/s > $ipfwcmd queue 1 config pipe 1 weight 1 mask dst-ip 0xffffffff > $ipfwcmd add queue 1 ip from any to 192.168.10.0/24{100-254} via em1 > > this will limit them to 80kB/s and perform fair-sharing based of hosts. > > for example if one user on one computer will start 100 downloads, and > other on other computer will start 1 download, this will ensure that > first user will not takeover most bandwidth. -- Martin Schweizer PC-Service M. Schweizer GmbH; Bannholzstrasse 6; Postfach 132; CH-8608 Bubikon; Tel. +41 55 243 30 00; Fax: +41 55 243 33 22; http://www.pc-service.ch