Individual Restrictions
Class 2 pools are perfect for limiting individual users on networks with fewer than 255 users. This creates a cap of 512 Kbit/s on the pool, and 128 Kbit/s on individual users, with a 2048 Kbit/s reserve:
|
|---|
You don’t have to use multiples of 8, you can use any numbers of bytes:
Excluding Local Traffic
It’s unlikely that you’ll want to place restrictions on LAN traffic, so let’s exclude it. It needs its own pool, so define two pools:
|
|---|
|
|---|
Creating a Privileged Class
Yes, you can play favorites and grant some users more bandwidth by selecting a specific range of IPs. You may use dotted quad, CIDR, or hostnames. You don’t have to specify a netmask, Squid will try to calculate it, but it’s a good idea to use one anyway:
|
|---|
And there you are, playing favorites to your heart’s content. Squid comes with a monitoring utility so you can see how things are working:
|
|---|
Bigger, Faster, Stronger
If your needs are more complex, you’re probably better off biting the bullet, and learning to implement tc or rshaper.
Resources
- Squid proxy-cache is chock-full of great documentation and resources.
- The Bandwidth Limiting HOWTO has some good pointers for refining your bandwidth management.
- If you want to rassle with iproute2, see the Linux Advanced Routing & Traffic Control HOWTO
This article was originally published ServerWatch on May 21, 2004. Prior to that it was published on Enterprise Networking Planet.