How to block websites for particular IPs by squid?

Please give solution with example or configuration file.

link|improve this question

feedback

4 Answers

You need somthing like this:

acl BlockedHost src 192.168.1.15
http_access deny BlockedHost

The config file is well commented searching for the word acl will help you further.

Squid acl faq

link|improve this answer
feedback
up vote 1 down vote accepted

Example :

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


Option 1 : Specify site with in configuration file,

acl special_clients src "/etc/squid/special_client_ips.txt"

acl facebook dstdomain .facebook.com

acl orkut dstdomain .orkut.com

Under http access

http_access allow facebook special_clients

http_access deny facebook

http_access deny orkut

http_access allow all


Option 2 : Stick both client IP s and destination domains into lists,

acl special_clients src "/etc/squid/special_client_ips.txt"

acl bad_domains dstdomain "/etc/squid/bad_domains.txt"

Under http access

http_access allow bad_domains special_clients

http_access deny bad_domains

http_access allow all

  • I get it from net, It work very well

  • Thanks cstamas

link|improve this answer
feedback

The thing u ve posted is exceptional , The Above thing u mentioned i.e blocking perticular sites to perticular clients ,is very useful to lot of them.

link|improve this answer
feedback

I have tried this but not luck. Hope my blog will helpful to you.

http://www.serveridol.com/2010/06/22/squid-proxy-limitting-access-to-a-website-ip-and-domains/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.