Friday, July 8, 2011

How to enable Time based access in squid proxy server ?

Below you can find the squid time based access.
Edit squid.conf and add the below mentioned lines

User Based restriction

acl USER1 proxy_auth raj
acl USER2 proxy_auth sam
acl DAY time 08:00-18:00
http_access allow USER1 DAY
http_access deny USER1
http_access allow USER2 !DAY
http_access deny USER2

Special Access

acl After_Office time SMTWHFA 20:00-24:00
acl Before_Office time SMTWHFA 00:00-08:30
acl Proxy_Afrer8 proxy_auth  user1 user2
http_access deny  Before_Office #(Deny access to all users)
http_access deny After_Office !Proxy_Afrer8  # (This will exclude user1,user2)
http_access allow ntlm_users
http_access deny all                   

IP Based Restriction

acl IPGROUP01 src
acl WORKINGHOUR time MTWHF 08:30-17:30
http_access allow IPGROUP01 WORKINGHOUR
http_access deny IPGROUP01

Restart squid