[squid-users] Limiting user's bandwidth

From: Landy Landy <landysaccount_at_yahoo.com>
Date: Sun, 24 Oct 2010 07:22:01 -0700 (PDT)

Hello everyone.

A while back I posted here that I was trying to control our user's bandwidth with iproute. I know it can be done with squid but, didn't want squid to do more than block some domains and do its caching which does pretty well. I have a script to control bw and assign each user 512kbps/256kbps. When I have squid running the control gets bypassed.

I was marking packets on the FORWARD chain which caused to the bypass since the pages are served from the gw by squid instead of just doing the FORWARD. Now, I did some thinking, and changed the chain marking the packet to look like this:

$iptables -t mangle -A POSTROUTING -d 172.16.250.1 -j MARK --set-mark 1053
$iptables -t mangle -A POSTROUTING -d 172.16.250.1 -j RETURN

This controls the download bandwidth the way I want it. Works well. Now, for the upload speed I guess I'm having the same problem as before. The upload speed does not get controlled. I applied this chain:

$iptables -t mangle -A POSTROUTING -s 172.16.250.1 -j MARK --set-mark 1054
$iptables -t mangle -A POSTROUTING -s 172.16.250.1 -j RETURN

and the user can upload at full speed.

Also tried PREROUTING and nothing.

I need to control upload since I have some users uploading videos, mp3, and other stuff that consume most of the upload bw.

Does anyone has an idea how can I control the upload speed?

Thanks in advanced for your time and input.

Wilson

      
Received on Sun Oct 24 2010 - 14:22:08 MDT

This archive was generated by hypermail 2.2.0 : Thu Oct 28 2010 - 12:00:04 MDT