April 25, 2009

Block Clients Based On Time Setting

End Result: A proxy server performing web-cache and implementing time based restrictions.

Scenario:

Proxy Server: linuxbox5 (192.168.0.15)
Proxy Server Port: 8080
Alowed Time: 9:00 AM to 09:00 PM

Perform al steps given above under the heading “Simple Web-cache Setup with Squid”. And do the

additional steps given below.

# vi /etc/squid/squid.conf

Add folowing ACL line

acl timechk time 09:00-21:00

Above this line

acl internal src 192.168.0.0/255.255.255.0

And change folowing line

From:
htp_access alow internal

To:
htp_access alow internal timechk

Here:
timechk : ACL name.

time: ACL type is time. Means we have set group of times and based on these time
groups we wil alow or deny clients.

htp_access alow internal timechk:
Tells squid to implement time restrictions on clients what belongs to internal group

(whose source IP addres is in between 192.168.0.1 – 253)

Save and exit and restart service.

# service squid restart

1 comment:

  1. hi i want to block some websites like facebook gmail orkut in office timing(9.00am:5.00pm) for all user in my lan. (192.168.1.1-255). can you tell me the steps how to do that settings.

    ReplyDelete