LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Tags used in this thread
Popular LQ Tags

Reply
 
Thread Tools
Old 11-04-2009, 11:07 AM   #1
sachin151080
LQ Newbie
 
Registered: Nov 2009
Posts: 5
Thanked: 0
Smile Squid Allow Block Site TO some ip


[Log in to get rid of this advertisement]
hi,

is there any way to allow blocked particular site to particular IP in squid or dansguardian.

will be very much thankfull
windows_xp_2003 sachin151080 is offline  
Tag This Post
Reply With Quote
Old 11-04-2009, 11:41 AM   #2
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 107
Quote:
Originally Posted by sachin151080 View Post
is there any way to allow blocked particular site to particular IP in squid or dansguardian.
Yes. This was actually asked and answered less than a week ago right here.
linuxubuntu win32sux is offline     Reply With Quote
Old 11-05-2009, 04:37 AM   #3
sachin151080
LQ Newbie
 
Registered: Nov 2009
Posts: 5
Thanked: 0

Original Poster
Smile squid allow block site to some ip

hi,

thanx for your reply

you not yet understand my question

i blocked Facebook & Orkut to all user but now i want to open only facebook to particular user or IP


Thankx
windows_xp_2003 sachin151080 is offline     Reply With Quote
Old 11-05-2009, 08:47 AM   #4
gr33d
LQ Newbie
 
Registered: Dec 2008
Posts: 17
Thanked: 0
im not intimately familiar with users in squid, but if you want to allow IPs, just add an ACL for the IP range (or several ACL's for each nonadjacent IP) and place some http_access_allow <ACL NAME> lines above the http_access_deny lines

if you provide the appropriate sections of your /etc/squid/squid.conf file, i could probably give you specific examples.
windows_xp_2003 gr33d is offline     Reply With Quote
Old 11-05-2009, 09:03 AM   #5
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 107
Quote:
Originally Posted by sachin151080 View Post
i blocked Facebook & Orkut to all user but now i want to open only facebook to particular user or IP
Only allow the IP to bypass the restriction on Facebook, right (not Orkut)?

You need to stick an http_access line above the one(s) which block the domains. Example:
Code:
acl special_client src 192.168.2.36
acl facebook dstdomain .facebook.com
acl orkut dstdomain .orkut.com

http_access allow facebook special_client
http_access deny facebook
http_access deny orkut
http_access allow all

Last edited by win32sux; 11-05-2009 at 09:04 AM..
linuxubuntu win32sux is offline     Reply With Quote
Old 11-06-2009, 01:35 AM   #6
sachin151080
LQ Newbie
 
Registered: Nov 2009
Posts: 5
Thanked: 0

Original Poster
Thumbs up squid allow block site to some ip

hi,

thanks win32sux

finally u resoved my problem, u r genious

my last question to u it is possible to create one file like exception ip list for particular site instead of creating acl for each ip & site

For Ex.

192.168.0.2 facebook.com
192.168.0.3 orkut.com
192.168.0.50 facebook.com

because no.of acl list may affect on performance of squid proxy

Once again thanx for your quick reply.
linuxfedora sachin151080 is offline     Reply With Quote
Old 11-06-2009, 05:56 AM   #7
gr33d
LQ Newbie
 
Registered: Dec 2008
Posts: 17
Thanked: 0
yes, this is possible. make your file. lets call it /etc/squid/badsites.acl and add this to your config file

acl badsites dstdomain "/etc/squid/badsites.acl"
http_access deny badsites

your file should look like this (one url per line):
url1
url2
url3

restart squid
windows_xp_2003 gr33d is offline     Reply With Quote
Old 11-06-2009, 12:21 PM   #8
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 107
I think you'd wanna do like gr33d said, but with an exception IP list instead.

You'd then match that ACL to certain domains, like:
Code:
acl special_clients src "/etc/squid/special_client_ips.txt"
acl facebook dstdomain .facebook.com
acl orkut dstdomain .orkut.com
http_access allow facebook special_clients
http_access deny facebook
http_access deny orkut
http_access allow all
You could also stick both client IPs and destination domains into lists, then do like:
Code:
acl special_clients src "/etc/squid/special_client_ips.txt"
acl bad_domains dstdomain "/etc/squid/bad_domains.txt"
http_access allow bad_domains special_clients
http_access deny bad_domains
http_access allow all
linuxubuntu win32sux is offline     Reply With Quote
Old 11-07-2009, 06:34 AM   #9
subhojit
LQ Newbie
 
Registered: Jul 2009
Posts: 2
Thanked: 0
Question how to allow some particular users to get access to the restricted site in squid

hi,
i want to restrict sites like orkut, gmail in squid but i want to give access of these sites to some specific users, how can i achieve it
linuxredhat subhojit is offline     Reply With Quote
Old 11-07-2009, 11:20 AM   #10
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 107
Quote:
Originally Posted by subhojit View Post
hi,
i want to restrict sites like orkut, gmail in squid but i want to give access of these sites to some specific users, how can i achieve it
Have you tried the examples provided above?
linuxubuntu win32sux is offline     Reply With Quote
Old 11-08-2009, 02:22 AM   #11
sachin151080
LQ Newbie
 
Registered: Nov 2009
Posts: 5
Thanked: 0

Original Poster
Thumbs up squid allow block site to some ip

hi,

win32sux

thanx for your valuable reply i tried both the option both are working fine
u given solution exactly what i want.


thanx u r genious in linux


Regards

Sachin J.
linuxfedora sachin151080 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i block a site hanumanvce Linux - Security 5 02-03-2009 07:20 AM
how to block a particular web site bkcreddy17 Linux - Newbie 2 09-02-2008 02:52 PM
Can you block IE from using this site? resetreset LQ Suggestions & Feedback 28 07-29-2008 09:57 AM
how do you block access to a site? smarthouseguy Slackware 3 05-14-2006 11:09 AM
squid acl how to block all site except some mikmok Linux - Networking 1 12-22-2003 09:20 AM


All times are GMT -5. The time now is 01:50 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration