Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2008 10:46:59 +0200
From:      "Rudi Kramer - MWEB" <rkramer@mweb.com>
To:        "Erik Danielsson" <eridan911@gmail.com>, <freebsd-questions@freebsd.org>
Subject:   RE: Limiting bandwidth
Message-ID:  <39DC135F7F0571489196E0B6F5D58B4A03B4606B@MWBEXCH.mweb.com>
References:  <c66fe0350808200008k671178jd9c3bad254e3eafa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Erik Danielsson
>=20
> Hello,
>=20
> Basically I want to limit the bandwidth for a every IP address not
within a
> given IP range. To complicate things a bit more, I only want to limit
the
> bandwidth once a certain amount of data, let's say 10 GiB, has been
> sent/received from an IP address outsite the IP range.
>=20
> I want the traffic counter to be reset at a specific time of my
choice, for
> example at midnight, which means that after midnight, the traffic
won't be
> limited (until 10 GiB has been transferred once again).
>=20
> I hope I made myself clear.
>=20
> Any ideas on how to do this?
>=20

Hi Eric,

The best way I know how is by using PF and ALTQ.

You will need to recompile your kernel to support ALTQ
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-pf.
html)=20

Once that's done you will need to spend some time reading Peter
Hansteen's  PF manual, http://home.nuug.no/~peter/pf/.  (If you are
impatient you can skip straight to
http://home.nuug.no/~peter/pf/en/altqintro.html but I would recommend
reading the entire manual.)

Once you've managed to wrap your head around pf and you've written and
implemented your rule set I would also recommend installing pftop to
check that your queues are working. (pftop -v queue)

If you need further help, mail freebsd-pf@freebsd.org with your rule set
and what's happening or not happening.

Rudi



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