Author Topic: [HELP] limit internet usage  (Read 4474 times)

codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
[HELP] limit internet usage
« on: October 09, 2012, 02:12:06 pm »
Hy there,

Any way i can set a quota limit to internet browsing/download?
I have lightsquid installed and i can know how many MB a computer have download and upload, can i set a limit so zentyal after that block all browsing?

Thanks

FarquahrWindsor

  • Guest
Re: [HELP] limit internet usage
« Reply #1 on: October 09, 2012, 02:23:10 pm »
There have been a few calls for much more detail and control of internet usage in a community wishlist.

I placed your method on there as it would be useful for myself as well.

christian

  • Guest
Re: [HELP] limit internet usage
« Reply #2 on: October 09, 2012, 02:26:55 pm »
May I invite you to have a look here?
It explains how to set up bandwidth throttling which may help.  Obviously, it assumes you have 3.0 installed.
2.x is slightly different in term of feature and interface but still permit to define maximum file size.

FarquahrWindsor

  • Guest
Re: [HELP] limit internet usage
« Reply #3 on: October 09, 2012, 02:32:45 pm »
Still doesn't allow you to provide a limit and then stop the users does it Christian.

It would be a good feature to have.

Added it to the poll http://forum.zentyal.org/index.php/topic,12350.msg50745.html#msg50745
« Last Edit: October 09, 2012, 02:38:23 pm by FarquahrWindsor »

codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
Re: [HELP] limit internet usage
« Reply #4 on: October 09, 2012, 02:35:24 pm »
Exactly... i don't want bandwith limit... i want close all the browsing if the user quota is used.

For instace:
all users of a object can use 500MB per day, after that no internet
all users of a object can use 5000MB per month, after that no internet
etc

Sam Graf

  • Guest
Re: [HELP] limit internet usage
« Reply #5 on: October 09, 2012, 02:43:53 pm »
Any way i can set a quota limit to internet browsing/download?

It looks like there is a way, using the captive portal. That allows you to set a bandwidth quota by day, week, or month (not and, but or). Captive portal might not work for you, of course, but I did want to mention the possibility.

christian

  • Guest
Re: [HELP] limit internet usage
« Reply #6 on: October 09, 2012, 02:49:55 pm »
Just curious: did you try to set parameters with bandwidth throttling ?

Extract from on line help (V.2.2)
Code: [Select]
Bandwith throttling allows you to control download rates for connections going though the HTTP proxy.
Network bandwidth rules (class 1 delay pools) allow you to limit the download rate for the whole network whereas client bandwidth
 rules (class 2 delay pools) allow you to limit the download rate on a per client basis. Class 1 pools have more priority than class 2
 pools and the first rule to match is applied. If a connection doesn't match any rule, then no bandwidth throttling is applied.

this is at network level.
Then at client level:
Code: [Select]
Once the download exceeds the file size then the HTTP Proxy will slow down the connection to the specified download rate.
 Both parameters can be defined for the whole network and on a per client basis. The client number is limited to 256.

What you may have not noticed is that despite title (bandwidth throttling) it also bring "file size" concept that again, may help.

codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
Re: [HELP] limit internet usage
« Reply #7 on: October 09, 2012, 02:51:47 pm »
Any way i can set a quota limit to internet browsing/download?

It looks like there is a way, using the captive portal. That allows you to set a bandwidth quota by day, week, or month (not and, but or). Captive portal might not work for you, of course, but I did want to mention the possibility.

Captive portal don't work for me...  i try it but isn't functional to the users :/

codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
Re: [HELP] limit internet usage
« Reply #8 on: October 09, 2012, 03:04:13 pm »
Just curious: did you try to set parameters with bandwidth throttling ?

Extract from on line help (V.2.2)
Code: [Select]
Bandwith throttling allows you to control download rates for connections going though the HTTP proxy.
Network bandwidth rules (class 1 delay pools) allow you to limit the download rate for the whole network whereas client bandwidth
 rules (class 2 delay pools) allow you to limit the download rate on a per client basis. Class 1 pools have more priority than class 2
 pools and the first rule to match is applied. If a connection doesn't match any rule, then no bandwidth throttling is applied.

this is at network level.
Then at client level:
Code: [Select]
Once the download exceeds the file size then the HTTP Proxy will slow down the connection to the specified download rate.
 Both parameters can be defined for the whole network and on a per client basis. The client number is limited to 256.

What you may have not noticed is that despite title (bandwidth throttling) it also bring "file size" concept that again, may help.

I try it, but the user still able to browse the web

i have this settings
Maximum unlimited size per client:    5 MB
Maximum unthrottled download size for each client.
Maximum download rate per client:    20 KB/s
Limited download rate after maximum size is reached for each client.

For what i understand, the download limit will be 20kb when the donwload is bigger then 5MB, but if the user keep download files of 3MB he can download 100 parts and have a full package of 300mb a very fast speed...

I'm correct?
« Last Edit: October 09, 2012, 03:06:28 pm by codedmind »

FarquahrWindsor

  • Guest
Re: [HELP] limit internet usage
« Reply #9 on: October 09, 2012, 03:04:57 pm »
This is what I need specifically, I have several community groups and the kids are murder for downloading music and video.

I don't want to throttle the wan because some users are downloading perfectly normal items and its occasionally.

From the log codemind provided it would be great to say look you have hit your limit for the day goodbye.

Thats it basically and even with the best attempts using the captive portal or bandwidth rules isn't going to supply the required result without having possible side effects for other uses that I don't want.

Don't know if this is exactly what you mean codeminded but I have forwarded it to the wishlist.

In fact it would be really good to have the limit for anyone session as sometimes we have several sessions per day.


codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
Re: [HELP] limit internet usage
« Reply #10 on: October 09, 2012, 03:09:16 pm »
This is what I need specifically, I have several community groups and the kids are murder for downloading music and video.

I don't want to throttle the wan because some users are downloading perfectly normal items and its occasionally.

From the log codemind provided it would be great to say look you have hit your limit for the day goodbye.

Thats it basically and even with the best attempts using the captive portal or bandwidth rules isn't going to supply the required result without having possible side effects for other uses that I don't want.

Don't know if this is exactly what you mean codeminded but I have forwarded it to the wishlist.

In fact it would be really good to have the limit for anyone session as sometimes we have several sessions per day.

Yes is exactly that :)

christian

  • Guest
Re: [HELP] limit internet usage
« Reply #11 on: October 09, 2012, 03:15:15 pm »
Then I assume you are using 2.2 correct ?

Because 3.0 permits, although not perfect, slightly better mechanism based on bucket as explained in Zentyal (or Squid too) documentation.

Still this is not quota, I know  ;)

some Squid-add-on may exist to handle quota but not available, as far as I know, with Zentyal and I never used it.
If you find one fitting your needs, you can still test it and bring it to community  8)
Some hints:
http://sourceforge.net/apps/trac/squidquota/
http://wiki.squid-cache.org/Features/Quota  (notice the "not started" status  ;)
« Last Edit: October 09, 2012, 03:26:03 pm by christian »

FarquahrWindsor

  • Guest
Re: [HELP] limit internet usage
« Reply #12 on: October 09, 2012, 03:22:11 pm »
For me christian no. Unless I am missing something. Does the bucket stop on a limit? Then thats it for the day.

The bucket service is a great addition and I can use it and will. But also I would just like to apply limits.

Especially with the drop in centres where we have casual internet browsing.

codedmind

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
Re: [HELP] limit internet usage
« Reply #13 on: October 09, 2012, 03:27:35 pm »
I have 3.0

And bandwith throttling don't do what i need...

christian

  • Guest
Re: [HELP] limit internet usage
« Reply #14 on: October 09, 2012, 03:44:17 pm »
Too bad  :-[

As I wrote in my first reply here in this thread, bandwidth throttling may help.
Sam Graf proposed captive portal.
If none fit your need, then I'm not aware of any working solution based on Squid.

You may find more input in Squid related mailing list. I know some years ago debate about (pure) quota management occurred but I don't know the current status.