Please help to click 1!

Wednesday 13 June 2012

Squid : How to block Facebook


Here the post will show you how to block complete "http" and "https" facebook access in office times in your squid proxy server. Create an acl with facebook domain (dstdomain) and deny both http and https access.






Add the Configurations to squid.conf. 
[root@server ~#]vi /etc/squid/squid.conf


#1: Create an acl for proxy clients
acl LAN src 192.168.1.1/24


#2: Create an acl for facebook domain  (any required sites)
acl fb dstdomain .facebook.com


#3: Create an acl office time for Mon-Sat, 10:00 to 17:00 (24hrs)
acl officetime time MTWHFA 10:00-17:00

#4: Deny access to "http" facebook to accountant only in office times
http_reply_access deny  fb LAN officetime

#5: Deny access to "https" facebook to accountant only in office times
http_access deny CONNECT fb LAN officetime
#(save the squid.conf configuration file)

#6: And finaly reload squid service to take effect changes
[root@server ~#]service squid reload


Tips: The way to include multiple sites in one ACL
acl fb dstdomain .facebook.com .twitter.com .blogger.com


No comments:

Post a Comment