bw limit of http downloads?

Dragon dragon at phreaker.net
Mon Jan 5 23:32:18 PST 2004


>Message: 1
>Date: Sun, 4 Jan 2004 13:01:58 -0800 (PST)
>From: tony at saign.com
>Subject: bw limit of http downloads?
>To: ipfw at freebsd.org
>Message-ID: <3466.66.146.166.53.1073250118.squirrel at p3.saignon.net>
>Content-Type: text/plain;charset=iso-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




More information about the freebsd-ipfw mailing list