How to set bandwidth quota on user in squid server

hi ,
i have to set a squid server in which i have to set bandwidth quota on user in linux
plz help
thanks in advance…

I think that what you want is this presentation (around slide 20)

thanks for your advice Mr. Molona, but i want to set bandwidth quota on AD user on monthly basis,
when they comsumed their bandwidth 90% , i have to send them warning msg/mail. if you have any more idea, plz share with me
thanks in advance.

I’ve moved the question to a more appropriate forum (I think), so you’ve got a better chance of getting useful replies.


It’s Miss Molona :wink: [/ot]

This is a fairly detailed set of steps[COLOR=#000000] and the full configuration file for creating a limiting pool in Squid.


hi Steve, thanks for your help and your link clear lots of point abt squid.
But I have solve this problem as below, if anyone have same problem.

Check this out, which may help!

Squid with PAM authentication & Squish

Squish will be set to run as the download manager for squid, meaning
that daily, weekly or monthly
download & time limits can be set on users or IP address.In this
how-to we will set squid
to use PAM authenication and limit the montly bandwidth each user has
with squish. The programs
used in this guide will be:

Name: Squish
Fuction: Total daily/weekly/monthly Bandwidth/Time Manager

Name: Squid
Fuction: proxy caching server for web clients

Name: Apache
Fuction: Webserver

  1. download from

  2. unzip into /install/

  3. cd into the folder

cd /install/squish-0.0.12

  1. make install

  2. then move yourself into the directroy that squish was installed in


  1. then run the install option on the

./ --install

  1. download the GD Graphics Library rpm’s from the website below

  1. and then install it

rpm -ivh perl-GD-2.30-1.1.fc3.rf.i386.rpm

  1. or you can get the source from

  2. run the command ‘crontab -e’ and then input the following into the file

5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/squish/

  1. then run the job for the first time


Now i’m going to use PAM to authenticate squid.

  1. now we need to edit the ‘/etc/squid/squid.conf’ and add the
    following lines in the right area’s

(in the basic area authentication area)
auth_param basic program /usr/lib/squid/pam_auth

(in the acl’s area)
acl pam proxy_auth REQUIRED

  1. at this point you can edit the squid pam module ‘/etc/pamd.d/squid’

  2. PAM (pluggable authenticate module) can authenticate against
    almost anything, unix, LDAP, winbind. it has many, many uses so look
    into PAM if you think it might be useful for you.

  3. now set the right permissions on /usr/lib/squid/pam_auth

chmod u+s /usr/lib/squid/pam_auth

  1. now set the squid ACLs to the following.

added by squish (begin)


acl SQUISHED1 proxy_auth “/etc/squid/squished”
deny_info http://ip-address-of-squish-serverr/squish/?squished& SQUISHED1
http_access allow SQUISHLOC
http_access allow pam !SQUISHED1

added by squish (end)

  1. now set the redirect in the apache configuration file

‘cat /usr/local/squish/apache-squish.conf >> /etc/httpd/conf/httpd.conf’

  1. restart the apache and squid servers now

‘/etc/init.d/squid restart’
‘/etc/init.d/httpd restart’

  1. go to http://ip-address-of-squish-server/squish/squish.cgi

  2. edit the ‘/etc/squid/squish.conf’ to change the download/hours limits

External Links: