I'd like to open all ports for specific user for specific length of time using IPtable. The current rule i have is:
$IPTABLES -A FORWARD -i $LAN_IF -o $OUTSIDE_IF -p tcp -s 192.168.10.34 -m state --state NEW -j ACCEPT
$IPTABLES -A FORWARD -i $LAN_IF -o $OUTSIDE_IF -p udp -s 192.168.10.34 -m state --state NEW -j ACCEPT
So, how can i specify length of time? eg. 7:00 am to 5:30 pm
With the
--timestart
and--timestop
statements (in 24h time format):See
man iptables
From the
iptables()
manpage one can learn that atime
module exists which does what you want: