How to control internet time access for each IP?
How to add time to this rule: iptables -I FORWARD -s 192.168.0.56 -j ACCEPT
?
I tried this
iptables -I FORWARD -s 192.168.0.56 -m time --timestart 13:00 --timestop 14:00 -j ACCEPT
and
iptables -I FORWARD -s 192.168.0.56 --match time --weekdays Mon,Tue,Wed,Thu,Fri --timestart 09:00 --timestop 10:00 -j ACCEPT
but it doesn't work
Maybe there is another way to do it?
Operating system: Ubuntu 18.04.4 LTS
root@router:/home/wlodek# iptables -L FORWARD
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 192.168.0.56 anywhere TIME from 09:00:00 to 10:00:00 on Mon,Tue,Wed,Thu,Fri UTC
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
IP: 192.168.0.56 - has a connection iptables -I FORWARD -s 192.168.0.56 -j ACCEPT
IP: 192.168.0.56 - no connection iptables -I FORWARD -s 192.168.0.56 -j ACCEPT
+ time
iptables -L FORWARD
? – Jonas Feb 25 '20 at 08:38192.168.0.56
to only allow traffic between 9 and 10 it seems reasonable that the traffic outside this window will be blocked. Rundate -u
on your router to make sure your trying to connect inside the right time-frame. – Jonas Feb 25 '20 at 09:22