rajasekarramasamy
asked on
Internet Bandwidth limitation for individual users in squid
We planned to configure a new squid proxy server in fedora 8. We want to implement bandwidth management in squid by using delaypool. We having 1mbps DSL connection. We going to give totally 500MB limited net usage for every one per day. If a single user reached his limit 500mb then that user should not able to access net for that day. He should only able to browse on next day only. Like this we want to implement bandwidth management.
Any real time example squid code is there for my bandwidth configuration?
Any real time example squid code is there for my bandwidth configuration?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi oklit,
Is there any step by step document for squish. I need a document to install & configure squish and i want to set bandwidth for each user using squish.
Is there any step by step document for squish. I need a document to install & configure squish and i want to set bandwidth for each user using squish.
ASKER
Hi oklit,
I installed & configured squish in my network it working fine. Thanks for your help.
I installed & configured squish in my network it working fine. Thanks for your help.
see the below step by step document
1. Download squish from
http://www.ledge.co.za/software/squint/squish/
2. Unzip squish into /install/
# tar -xvzf squish-x.x.x.tar.gz
3. cd into the folder
# cd squish-0.0.18
4. Install Squash
# make install
5. Then move yourself into the squish directory that squish was installed in
# cd /usr/local/squish/
6. Then run the squish install option on the squish.pl
# ./squish.pl --install
7. Download the GD Graphics Library rpm's from the website below
http://dag.wieers.com/packages/perl-GD/
8. And then install it
# rpm -ivh perl-GD-x.x.x..fc3.rf.i386 .rpm
Now set the squid ACLs to the following.
# vi /etc/squid/squid.conf
squid.conf:
### added by squish (begin)
# acl's for squish - autodetected, sometimes
acl SQUISHLOC dst mc1.fedora.directory.serve r
acl SQUISHED1 proxy_auth -i "/etc/squid/squished"
acl password proxy_auth REQUIRED
#acl SQUISHED2 ident "/etc/squid/squished"
acl SQUISHED3 src "/etc/squid/squished"
# Error info that says you're squished
deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED1
#deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED2
deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED3
# HTTP access controls for squish
http_access allow SQUISHLOC
http_access allow password !SQUISHED1
http_access deny SQUISHED1
#http_access deny SQUISHED2
http_access deny SQUISHED3
### added by squish (End)
9. Now set the redirect in the apache configuration file for the squish cgi program
#vi /etc/httpd/conf/httpd.conf
httpd.conf:
include /usr/local/squish/apache-s quish.conf
10. Now edit the apache-squish.conf file
# vim /usr/local/squish/apache-s quish.conf
apache-squish.conf:
Alias /squish "/usr/local/squish/"
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex squish.cgi
AllowOverride None
Order allow,deny
Allow from all
10. Restart the apache and squid servers now
# service squid restart
# service httpd restart
11. Go to http://ip-address-of-squish-server/squish/squish.cgi to see what your usage is.
12. Edit the squish.conf file to change the download/hours limits
# vi /etc/squid/squish.conf
==================
squish.conf:
# This file contains data formatted as follows:
#
# Blank lines and hashed stuff is for comments
# user amount/period
# bandwidth: 999[kmG]b / period: day, week, month
# time: 999[smh] / period: day, week, month
#
# Whitelist entries - they can have as much as they like
192\.168\.99\.44 25h/day
192\.168\.97\.43 25h/day
# Poor guy:
root 1h/day 1Mb/day 2Mb/week
vinod 1h/day 1Mb/day 2Mb/week
# Catchall -- people and IP's not matched by the above rules
.* 4h/day 20Mb/day 20h/week 100Mb/week
===================
for more details pl follow
http://www.ledge.co.za/software/squint/squish/FAQ
http://www.ledge.co.za/software/squint/squish/
1. Download squish from
http://www.ledge.co.za/software/squint/squish/
2. Unzip squish into /install/
# tar -xvzf squish-x.x.x.tar.gz
3. cd into the folder
# cd squish-0.0.18
4. Install Squash
# make install
5. Then move yourself into the squish directory that squish was installed in
# cd /usr/local/squish/
6. Then run the squish install option on the squish.pl
# ./squish.pl --install
7. Download the GD Graphics Library rpm's from the website below
http://dag.wieers.com/packages/perl-GD/
8. And then install it
# rpm -ivh perl-GD-x.x.x..fc3.rf.i386
Now set the squid ACLs to the following.
# vi /etc/squid/squid.conf
squid.conf:
### added by squish (begin)
# acl's for squish - autodetected, sometimes
acl SQUISHLOC dst mc1.fedora.directory.serve
acl SQUISHED1 proxy_auth -i "/etc/squid/squished"
acl password proxy_auth REQUIRED
#acl SQUISHED2 ident "/etc/squid/squished"
acl SQUISHED3 src "/etc/squid/squished"
# Error info that says you're squished
deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED1
#deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED2
deny_info http://mc1.fedora.directory.server/squish/?squished& SQUISHED3
# HTTP access controls for squish
http_access allow SQUISHLOC
http_access allow password !SQUISHED1
http_access deny SQUISHED1
#http_access deny SQUISHED2
http_access deny SQUISHED3
### added by squish (End)
9. Now set the redirect in the apache configuration file for the squish cgi program
#vi /etc/httpd/conf/httpd.conf
httpd.conf:
include /usr/local/squish/apache-s
10. Now edit the apache-squish.conf file
# vim /usr/local/squish/apache-s
apache-squish.conf:
Alias /squish "/usr/local/squish/"
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex squish.cgi
AllowOverride None
Order allow,deny
Allow from all
10. Restart the apache and squid servers now
# service squid restart
# service httpd restart
11. Go to http://ip-address-of-squish-server/squish/squish.cgi to see what your usage is.
12. Edit the squish.conf file to change the download/hours limits
# vi /etc/squid/squish.conf
==================
squish.conf:
# This file contains data formatted as follows:
#
# Blank lines and hashed stuff is for comments
# user amount/period
# bandwidth: 999[kmG]b / period: day, week, month
# time: 999[smh] / period: day, week, month
#
# Whitelist entries - they can have as much as they like
192\.168\.99\.44 25h/day
192\.168\.97\.43 25h/day
# Poor guy:
root 1h/day 1Mb/day 2Mb/week
vinod 1h/day 1Mb/day 2Mb/week
# Catchall -- people and IP's not matched by the above rules
.* 4h/day 20Mb/day 20h/week 100Mb/week
===================
for more details pl follow
http://www.ledge.co.za/software/squint/squish/FAQ
http://www.ledge.co.za/software/squint/squish/
ASKER
Hi mvsnaniou,
I have configure squish successfully. Thanks for your reply.
Please clear my doubt
Squish will reset the quota by next data automatically. I want to customized the squish reset time. Is there any changes need to be done in squish file?
Please reply to this question as soon as possible.
I have configure squish successfully. Thanks for your reply.
Please clear my doubt
Squish will reset the quota by next data automatically. I want to customized the squish reset time. Is there any changes need to be done in squish file?
Please reply to this question as soon as possible.
ASKER
In FAQ there is no information for quota reset time please check this. They have mention only tomorrow. I need to set quota reset time by my own time settings. for example @ every day @9:00 am quota to be reset.
Q. Help! I've been squished!
A. Sorry.
Q. I'm sorry! I didn't mean it! Can I have an emergency reserve?
A. No - sorry - ask your friendly sysadmin, or use another account / computer,
etc.
Q. How long must I wait?
A. You must wait until your data falls off the end of the graph. This is
usually until tomorrow (especially on Fridays).
Q. Help! I've been squished!
A. Sorry.
Q. I'm sorry! I didn't mean it! Can I have an emergency reserve?
A. No - sorry - ask your friendly sysadmin, or use another account / computer,
etc.
Q. How long must I wait?
A. You must wait until your data falls off the end of the graph. This is
usually until tomorrow (especially on Fridays).
As far as I know, squish just looks on date in squid logs, so there is no option to achieve what you want.
In order to emulate bandwidth speed, packet loss etc you can use standard linux TC (traffic control ) tool.
http://www.rns-nis.co.yu/~mps/linux-tc.html
There is even a web interface for the tool.
http://linux.softpedia.com/get/System/Networking/Simple-PHP-Internet-Traffic-Shaping-17024.shtml
Hope that will help, feel free to ask any questions.
Kind regards,
t.