LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2012, 10:37 PM   #1
Hira Inam
LQ Newbie
 
Registered: Aug 2012
Posts: 15
Blog Entries: 3

Rep: Reputation: Disabled
how to limit downloading in squid proxy.


Dear All, please guide me how to limit downloading in squid proxy through acl.

MY acl for 1 user is as follows:
acl me src 10.16.0.39
reply_body_max_size 52428800 deny me
acl blocksites dstdomain "/blocksites"
acl blockdownloading urlpath_regex "/blockdownloading"
deny_info ERR_BLOCKED_FILES blockdownloading
http_access deny blockdownloading
http_access deny blocksites
http_access allow me
http_access deny all

but it is not stoping downling of movie thorugh torrent.

Last edited by Hira Inam; 08-08-2012 at 12:22 AM.
 
Old 08-08-2012, 12:20 AM   #2
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
Request to please change the subject line. And give some name which is more specific to your problem.
This will help others to help you.
 
Old 08-08-2012, 09:24 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Hira Inam View Post
Dear All, please guide me how to limit downloading in squid proxy through acl.

MY acl for 1 user is as follows:
acl me src 10.16.0.39
reply_body_max_size 52428800 deny me
acl blocksites dstdomain "/blocksites"
acl blockdownloading urlpath_regex "/blockdownloading"
deny_info ERR_BLOCKED_FILES blockdownloading
http_access deny blockdownloading
http_access deny blocksites
http_access allow me
http_access deny all

but it is not stoping downling of movie thorugh torrent.
Right...why should it? Squid is an HTTP proxy...torrents run through different ports, and different protocols. There is one method you can TRY, and it's listed on the Squid website/documentation:
http://www.linux-support.com/cms/blo...squid-proxies/

It blocks the .torrent type through the browsers...but, someone could just copy the link location, fire up their torrent downloader, paste the link in, and bypass it. This is a fairly complex problem, and there have been solutions posted here before:
https://www.linuxquestions.org/quest...-squid-941462/
https://www.linuxquestions.org/quest...-squid-907942/
https://www.linuxquestions.org/quest...rrents-830666/
 
1 members found this post helpful.
Old 08-08-2012, 10:59 PM   #4
Hira Inam
LQ Newbie
 
Registered: Aug 2012
Posts: 15

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
But i want to limit on downloading not on torrent.
 
Old 08-09-2012, 09:13 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Hira Inam View Post
But i want to limit on downloading not on torrent.
Then why did you say in your initial question:
Quote:
Originally Posted by Hira Inam
but it is not stoping downling of movie thorugh torrent.
You specifically mentioned torrents, which Squid will not throttle. Again, a good place to start is Google and the Squid documentation...pay particular attention to the delayPools directive:
http://wiki.squid-cache.org/Features/DelayPools
 
Old 08-09-2012, 10:38 PM   #6
Hira Inam
LQ Newbie
 
Registered: Aug 2012
Posts: 15

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
Actually i want that any of my user cant download any file size greater than 20 MB say.

Last edited by Hira Inam; 08-09-2012 at 10:46 PM.
 
Old 08-10-2012, 10:02 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Hira Inam View Post
Actually i want that any of my user cant download any file size greater than 20 MB say.
If you had asked this question first, it would have saved everyone alot of guessing. And did you try looking this up?? Again, the squid documentation is easy to find and search:

http://www.squid-cache.org/Doc/confi...body_max_size/
 
Old 08-10-2012, 10:22 PM   #8
Hira Inam
LQ Newbie
 
Registered: Aug 2012
Posts: 15

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
Can you please check my acl allowing user1 not to download above 50 MB and allowing boss downloading with full access ?

acl user1 src 10.16.0.39
acl boss src 10.16.0.111
acl blocksites dstdomain "/blocksites"
acl blockdownloading urlpath_regex "/blockdownloading"
deny_info ERR_BLOCKED_FILES blockdownloading
reply_body_max_size 52428800 deny user1
reply_body_max_size 52428800 allow boss
http_access deny blockdownloading
http_access deny blocksites
http_access allow user1
http_access allow boss
http_access deny all
 
Old 08-12-2012, 10:34 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Hira Inam View Post
Can you please check my acl allowing user1 not to download above 50 MB and allowing boss downloading with full access ?

acl user1 src 10.16.0.39
acl boss src 10.16.0.111
acl blocksites dstdomain "/blocksites"
acl blockdownloading urlpath_regex "/blockdownloading"
deny_info ERR_BLOCKED_FILES blockdownloading
reply_body_max_size 52428800 deny user1
reply_body_max_size 52428800 allow boss
http_access deny blockdownloading
http_access deny blocksites
http_access allow user1
http_access allow boss
http_access deny all
Better, why don't you implement this ACL and try it for yourself???
 
Old 08-12-2012, 10:18 PM   #10
Hira Inam
LQ Newbie
 
Registered: Aug 2012
Posts: 15

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
I have already implemented it, but the issue is when user1 downloads any movie through utorrent it keeps on downloading with no limit on 50 MB.
 
Old 08-15-2012, 07:43 AM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Hira Inam View Post
I have already implemented it, but the issue is when user1 downloads any movie through utorrent it keeps on downloading with no limit on 50 MB.
Did you not understand post #3? Torrents are not running through Squid..you need to block them with different methods. Did you read the links provided in that reply??
 
Old 08-15-2012, 09:41 AM   #12
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Rep: Reputation: 9
are you running squid in transparent mode if yes?
torrents are not blocked by squid but I was able to deal with torrent by implementing squid in non-transparent mode(manually setting proxy in browsers)
as for the downloading problem i used delay_pools which decrease download speed when limit is crossed.
 
Old 08-15-2012, 09:59 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ac_kumar View Post
are you running squid in transparent mode if yes?
The OP clearly posted rules that require a user ID...which means they're clearly not using transparent mode
Quote:
torrents are not blocked by squid but I was able to deal with torrent by implementing squid in non-transparent mode(manually setting proxy in browsers)
You're confused as to what transparent proxy means, and setting up transparent/non-transparent proxy has ZERO to do with blocking ports. Squid CAN NOT block torrents. It's an http proxy...all you can do is block the .torrent file type, but again (as has been said before), a user can simply cut/paste that link into a torrent client, and bypass squid.
Quote:
as for the downloading problem i used delay_pools which decrease download speed when limit is crossed.
Yes...that was stated to the OP before as well.
 
Old 08-15-2012, 02:39 PM   #14
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Rep: Reputation: 9
Quote:
Originally Posted by TB0ne View Post
The OP clearly posted rules that require a user ID...which means they're clearly not using transparent mode

You're confused as to what transparent proxy means, and setting up transparent/non-transparent proxy has ZERO to do with blocking ports. Squid CAN NOT block torrents. It's an http proxy...all you can do is block the .torrent file type, but again (as has been said before), a user can simply cut/paste that link into a torrent client, and bypass squid.

Yes...that was stated to the OP before as well.
I know squid is a http proxy but if you use squid in non-transparent mode by which I mean users has to manually set proxy settings in browsers
torrent downloads can be stopped.
I have used it for stopping torrent downloads. Have tried it even once ..............................!
 
Old 08-15-2012, 02:50 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ac_kumar View Post
I know squid is a http proxy but if you use squid in non-transparent mode by which I mean users has to manually set proxy settings in browsers torrent downloads can be stopped.
Nope, sorry. Again, you can block the .torrent filetype, but NOT the torrent itself. And how, exactly, does it matter if the browser picks up proxy settings automatically, or if you set them manually?? The traffic flows through the SAME SERVER, and abides by the same rules.
Quote:
I have used it for stopping torrent downloads. Have tried it even once ..............................!
Great...how about posting exactly how you did it, since you have apparently accomplished something impossible...that is, turning an http proxy into a Layer-7 filter.

Post the ruleset/ACL, since you've already done it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration