Koozali.org: home of the SME Server

Bandwidth limiting needed

Mike Wainscott

Bandwidth limiting needed
« on: July 02, 2002, 04:08:00 AM »
Has anyone successfully implemented bandwidth limiting for the client machines under 5.1.2?  I need to be able to restrict specific client machines to a certain amount of bandwidth in order to keep them from monopolizing my DSL line.

Lazo

Re: Bandwidth limiting needed
« Reply #1 on: July 03, 2002, 03:13:19 AM »
I heard something about CBQ!!

KegRaider

Re: Bandwidth limiting needed
« Reply #2 on: July 03, 2002, 04:56:45 AM »
Just use Squid, with delay pools.  I use it here.  I gave the server the magic words to limit (eg  .zip .mp3 .mov .asf .avi .rm .wmf .iso .bin .tar  etc etc.) and told the configuration to throttle the bandwidth back to 3k/s after it hits 100Kb of downloading.  They will still get the files, but, not at any great speeds.

If you want the configuration file that I use, just let me know.

Mike Wainscott

Re: Bandwidth limiting needed
« Reply #3 on: July 03, 2002, 08:24:41 AM »
Thanks for the idea Keg.  I'm not sure if squid is the right approach for me though.  isn't squid limited to proxying http requests?  What about UDP, etc?  I really need something (like CBQ perhaps?) that handles the whole gamut if possible.

Lazo

Re: Bandwidth limiting needed
« Reply #4 on: July 05, 2002, 04:03:10 AM »
i have e-smith v 5.0 update 4, does this version has delay pools?? do you have to install it then?? or I just need your configuration file?? I that's all would you provide me with the file??

thanks!!

Manuel Lazo

KegRaider

Re: Bandwidth limiting needed
« Reply #5 on: July 06, 2002, 04:43:19 PM »
This is my EXACT squid conf file.  You will notice that I also have SquidGuard running.  That is only to stop the Porn from entering our internet cafe.  Squidguard is NOT needed for just bandwidth limiting.  Also, you should copy the delay pools section to a template with the rest of your squid templates.

As with all scripts from the internet, Please check them before use, I will NOT be held responsible for your inability to read.  It works for me.

#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# Mitel Networks server software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org/.
#
# copyright (C) 2001 Mitel Networks Corporation
#------------------------------------------------------------


acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localsrc src 127.0.0.1 192.168.1.0/255.255.255.0
acl localdst dst 127.0.0.1 192.168.1.0/255.255.255.0
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 1025-65535 980
acl CONNECT method CONNECT
acl webdav method PROPFIND TRACE PURGE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK
cache_mgr support@xxxxxxxxx.com.au
ftp_user nobody@xxxxxx.com.au
http_access allow manager localsrc
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localsrc
http_access deny all

redirect_program /usr/local/bin/squidGuard
redirect_children 5


httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
icp_access allow all
miss_access allow all

store_avg_object_size 3 KB
cache_mem 64 MB
maximum_object_size 6144 KB
minimum_object_size 1 KB
always_direct allow webdav
always_direct allow all

#######DELAY POOLS START##################

#not limit localnetwork d/l
acl magic_words1 url_regex -i 192.168 liveupdate symantec microsoft windows update

# these files get limited from net
acl magic_words2 url_regex -i .exe .vqf .tar.gz .gz .rpm .tar .zip .rar .ace .wmf .raw .wav .swf .wzs

#third delay pool - banned files
acl magic_words3 url_regex -i .mp3 .mpeg .mpg .wma .avi .bsp .mov .wad .mpe .wma .asf .iso .bin .qt .ram .rm .viv

#limit bandwidth at day not night
acl day time 08:00-23:00

#2 delay pools, different delay_class
delay_pools 3

#first delay pool
#no delay for lan
#first delay class of second type
delay_class 1 2

#-1/-1 means no limits
delay_parameters 1 -1/-1 -1/-1

#magic_words1:192.168 we have set before
delay_access 1 allow magic_words1

#second delay pool
#to delay magic_words2
delay_class 2 2

#third pool - banned
delay_class 3 2

# delay is in bytes;doesn't consider start/stop bits(modem)
#delay_parameters 2 value1/value2 value3/value4
#value1/2 whole network(total bw), 3/4 per ip
#d/l at val1 after d/l'd over value2

delay_parameters 2 9000/100000 3000/80000
delay_parameters 3 2/10 2/10
#we have set day to 08:00-23:00 before
delay_access 2 allow day
delay_access 2 deny !day
delay_access 2 allow magic_words2
delay_access 3 allow day
delay_access 3 deny !day
delay_access 3 allow magic_words3
######DELAY POOLS CONFIG END#############

Regards,

KegRaider.