Blocking IP,Domain,Time to Access Websites in Squid Proxy Server !
By Fahad Ahammed
- 2 minutes read - 245 wordsWe can control website or ip to access or accessed by squid proxy server . We can set timely access rule or some ip range to acccess the server or also can block some website or ip for a range of ip or for some limited time .
#To block a particular Network:
#To block a particular ip:
#To block a particular URL:
#To block a list of sites from / specified in a file:
#Blocking web access by time:
#acl aclname time [day-abbrevs] [h1:m1-h2:m2]
#h1:m1 must be less than h2:m2
#Day-abbrevs:
#S – Sunday,M – Monday,T – Tuesday,W – Wednesday,H – Thursday,F – Friday,A – Saturday
#To block the URLs contains the word “word”:
#To prevent downloading files:
#To block access to some TLDs:
—————————————————————————————————-
Now create block file and service restart
[root@ubuntu Desktop]# /etc/init.d/squid3 restart
Stopping squid: [FAILED]
Starting squid: . [ OK ]
[root@ubuntu Desktop]# chkconfig squid3 on
#1: Create an acl for proxy clients.
#2: Create an acl for facebook domain (any required sites)
#3: Create an acl office time for Mon-Sat, 10:00 to 17:00 (24hrs)
#4: Deny access to “http” facebook to accountant only in office times
#5: The below line will deny access to “https” secured facebook to the proxy user “accountant” in office times. Squid proxy will deny access to “https” facebook to accountant only in office times.
[root@ubuntu ~#]service squid3 restart
Tips: The way to include multiple sites in one ACL
acl badsites dstdomain .facebook.com .twitter.com .blogger.co