Time limit with squid

I have nice kids, that love Internet. Sometimes a bit too much too our state, and with my wife we decided that after a certain hour during the week, it was wise to shutdown the Web access for the kids’ machines so they could start thinking sleeping ;-)

As I have a transparent proxy setup, I looked at how to do that with Squid 2.5 (old I know !) and used google to find examples.

The ones I found first turned out to be wrong in their explanations and the squid doc lacks of an example here.

Especially, the names of days should NOT be separated by spaces. Instead you rather need to use other examples which give good advises, and also explain the constraints on the hours.

So I came up with this configuration:

#Time
acl bfore_time time SMTWH 00:00-06:00
acl after_week time SMTWH 22:30-24:00
acl after_wend time FS 23:30-24:00
#Kids
#acl punition src 192.168.x.y/32
acl kids src 192.168.x.y1/32 192.168.x.y2/32 192.168.x.y3/32
#http_access deny punition
http_access deny kids bfore_time
http_access deny kids after_week
http_access deny kids after_wend

That way they are restricted to using the Web between 10:30PM and 6:00AM during the week, and later (11:30PM) the week-end. And I can ban one easily in case of punishment ;-)

Of course, that’s not a completely blocked context, as they can use our machines, or try to change the IP address (but they aren’t root and dn’t know that yet – but could learned which would be great !!). But it’s a kind reminder when it’s becoming late.

ACLs in Squid are very powerfull, and combined with Squiguard, you can also activate parental control if you want.

About these ads

Tags: , , , , ,

One Response to “Time limit with squid”

  1. Laurent Says:

    Indeed, squid is very powerfull (but only for http). To do the same thing, i installed an ALCASAR captive portal on an mini-ITX box. All my family is now protected and i can offer wifi access to others without problems. ALCASAR works only with Mandriva (www.alcasar.info).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 102 other followers

%d bloggers like this: