Squid allow Internet on working hours

1. Make file net_allow.txt (network allow to use internet)
#vi net_allow.txt
---------------------------net_allow.txt-----------------------
#insert your allow network
#Example
192.168.1.0/24
192.168.2.0/28
192.168.3.99
---------------------------net_allow.txt-----------------------


2. Make ERR file
(You can skip this if you don't want to ask your user to know detail about your block)
vi /squid/errors/ERR_BLOCK_Out_time
#Make Simple HTML
-----------------------------ERR_BLOCK_Out_time--------------
#HTML file
#Up to your imagin
-----------------------------End of ERR_BLOCK_Out_time-----------


3. Edit squid.conf
#vi squid.conf
---------------------------squid.conf----------------------------
#Techtoy allow internet working hours
acl working1 time 08:30-12:00
acl working2 time 13:00-17:30
acl working3 time 18:00-22:00
acl out_time1 time 22:01-24:00
acl out_time2 time 01:00-08:30
acl out_time3 time 12:01-12:59
acl out_time4 time 17:31-17:59

#Techtoy block internet working hours
http_access allow working1 net_allow
http_access allow working2 net_allow
http_access allow working3 net_allow

deny_info ERR_BLOCK_Out_time net_allow #skip this if you skip 2nd
http_access deny out_time1 net_allow
http_access deny out_time2 net_allow
http_access deny out_time3 net_allow
http_access deny out_time4 net_allow
---------------------------End of squid.conf----------------------------

4. Restart squid
#service squid restart




Good luck.

ความคิดเห็น

บทความที่ได้รับความนิยม