You are not logged in.

#1 2009-09-30 11:42:31

beretta
Member
Registered: 2008-04-21
Posts: 133

Restricting Network Access

This is probably a question with a really simple solution, but for all my searching I'm not finding it.  (Not coming up with the right key words?)

I'd like to have my computer automatically shut down the network between certain times of the day (an effort to be more productive).  The computer needs to be useable still for some things, but would deny web browsing etc. except for perhaps a small whitelist.  Configuring the router is not an option, as it needs to be only one specific computer on the home network.

Is there a software way to configure such a setup?

Offline

#2 2009-09-30 12:03:15

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Restricting Network Access

Block all traffic between 3:00pm and 9:00pm:

iptables -I OUTPUT -m time --timestart 15:00 --timestop 21:00 -j REJECT

Block all HTTP traffic between 10:00am and 12:00pm:

iptables -I OUTPUT -p tcp --dport 80 -m time --timestart 10:00 --timestop 12:00 -j REJECT

Block all HTTP, HTTPS and FTP traffic between 11:00am and 2:00pm on weekdays only:

iptables -I OUTPUT -p tcp -m multiport --dports 80,443,21 -m time --timestart 11:00 --timestop 14:00 --weekdays Mon,Tue,Wed,Thu,Fri -j REJECT

Block all traffic on weekends:

iptables -I OUTPUT -m time --weekdays Sa,Su -j REJECT

To add exceptions, put some rules above this to explicitly allow. Example, to allow access to the Arch Forums:

iptables -I OUTPUT -d 66.211.214.131 -j ACCEPT

Last edited by fukawi2 (2009-09-30 12:05:57)

Offline

Board footer

Powered by FluxBB