Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jan 2004 02:32:09 -0500
From:      "Dragon" <dragon@phreaker.net>
To:        freebsd-ipfw@freebsd.org
Subject:   Re: bw limit of http downloads?
Message-ID:  <200401060232090840.06D4EA3A@smtp.phreaker.net>
In-Reply-To: <20040105200045.553EA16A4F2@hub.freebsd.org>
References:  <20040105200045.553EA16A4F2@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

>Message: 1
>Date: Sun, 4 Jan 2004 13:01:58 -0800 (PST)
>From: tony@saign.com
>Subject: bw limit of http downloads?
>To: ipfw@freebsd.org
>Message-ID: <3466.66.146.166.53.1073250118.squirrel@p3.saignon.net>
>Content-Type: text/plain;charset=3Diso-8859-1
>
>I've been toying with the idea of limiting port 80 downloads from my box.
>Seems some people can't be polite, and do it themselves??
>
>Is their a quick way using a single pipe/queue to restrict port 80 to say
>128K downloads?
>
>Thanks,
>-Tony

Since the ipfw(8) manual page can be a little confusing for someone little
experience using pipes, try the following.

Let's say 1.2.3.4 is the IP address that you have your httpd running on, 
rule number 400 is where the piping is to placed, and dc0 is the network=
 interface:

	ipfw pipe 1 config bw 128KBytes/s mask src-ip 1.2.3.4
	ipfw add 400 pipe 1 tcp from 1.2.3.4 80 to any out via dc0

You can also use address/masklen (ie. 1.2.3.4/24) in place of a single=
 address if
you have your httpd running on multiple addresses.

I hope this gives you a good example.

-Alec Masters




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401060232090840.06D4EA3A>