Skip to contentSkip to conversation

Time changes

DISCUSSION Steffen Bisgaard - Xtrasource 3 participants 3 messages Oct 22, 2003 – Oct 23, 2003

lore
Share & tools
lore
#0 lore raw

Hallo list,

A quick question: Is it possible to block access to and from a PC (say 10.2.0.3) at a specific time, for example 21:00, and re-enable it at 08:00 the next day using iptables - and if so how?? Yes this is the kids PC... It used to be real simple with ipfw - I can't remember the syntax but something along the lines of ipfw -add (or -remove) deny (or allow) 10.2.0.3 all

Any ideas? Or do I need two separate iptables scripts?

#1 lore raw

Yes, you would need to utilize the time patch. Go to the following Howto to read up about it.
http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-3.h
tml#ss3.19

Brandon Broyles
----- Original Message -----
From: Steffen Bisgaard - Xtrasource
To: [email protected]
Sent: Wednesday, October 22, 2003 3:44 PM
Subject: Time changes

Hallo list,

A quick question: Is it possible to block access to and from a PC (say
10.2.0.3) at a specific time, for example 21:00, and re-enable it at 08:00 the next day using iptables - and if so how?? Yes this is the kids PC...
It used to be real simple with ipfw - I can't remember the syntax but
something along the lines of ipfw -add (or -remove) deny (or allow) 10.2.0.3 all

Any ideas? Or do I need two separate iptables scripts?

#2 lore raw
In reply to Steffen Bisgaard - Xtrasource
Quoted 11 lines · Steffen Bisgaard - Xtrasource

Hallo list,

A quick question: Is it possible to block access to and from a PC (say 10.2.0.3) at a specific time, for example 21:00, and re-enable it at 08:00 the next day using iptables - and if so how?? Yes this is the kids PC...
It used to be real simple with ipfw - I can't remember the syntax but something along the lines of ipfw -add (or -remove) deny (or allow) 10.2.0.3 all

Any ideas? Or do I need two separate iptables scripts?

Not full scripts. Try creating two cron jobs - one running at 21:00 the other at 08:00. One is just:
iptables -I FORWARD 1 -s 10.2.0.3 -j REJECT
the other
iptables -D FORWARD -s 10.2.0.3 -j REJECT

j