[BangPypers] Python script to limit access to Internet...

Noufal Ibrahim noufal at nibrahim.net.in
Wed Jun 27 10:35:42 CEST 2012

Vishal <vsapre80 at gmail.com> writes:

> Hello,
> I would like to limit internet access at my home, for some computers.
> Basically for a given time during the day (read schedule), I wish that the
> a given computer should not be able to access the internet.
> However, the computer is still connected to the internal LAN, so file/print
> sharing should be allowed.
> Something like what this software does:  http://www.blumentals.net/inetprot/
> And, of course I would like to do this in Python.

There are a number of ways to do this and a number of pieces your
program will have. 

The timer part which is trivial and which you can outsource to cron
(lock down at such and such time).

As for the restrictions, the most reliable way I can think of (which is
not cross platform) is to first change your firewall rules to disallow
connections outside of a specific network (except for maybe some
protocols like ssh if you need them) and then to change your root
password to something random so that you can't break out of your
setup. It should have a way of reverting your password too and also some
kind of fail safe (e.g. reboot to get back regular functionality) etc. 

Luckily for you, this has been implemented atleast for Gnu/Linux as is
available as http://thomer.com/lockout/



More information about the BangPypers mailing list