FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

12682 questions

15065 answers

24137 comments

47098 members

0 votes
283 views 4 comments
by

Hallo, I have just purchased a RUT router. I am on the forum for the first time. I am trying to restrict access to the internet overnight, say 1am until 7am. I connect to the internet via Wifi. As far as I  can see, there are two possibilities to do this. either a) HOTSPOT, INTERNET ACCESS RESTRICTION SETTINGS or b) INPUT/OUTPUT, OUTPUT, PERIODIC CONTROL & SCHEDULER. I have tried both without success. I have also updated the current time setting via TIME SYNCHRONISATION. The time is correct. I cannot see any reference to this problem in the forum. What am I doing wrong? Thanks for your help.

1 Answer

0 votes
by
Hi,

Rules:

iptables -A INPUT -m time --timestart 09:00 --timestop 18:00 --weekdays Mon,Tue,Wed,Thu,Fri -j DROP

iptables -A OUTPUT -m time --timestart 09:00 --timestop 18:00 --weekdays Mon,Tue,Wed,Thu,Fri -j DROP

Insert these in System > User Scripts and your wanted functionality should work.

Hope this helps.

EB.
by
Thanks for your response. I am really a layman so just want to be sure. If I want to block between 1am and 7am, would I write the following? -timestart 07:00 -timestop 01:00. Also it appears your instruction just blocks Monday thru Friday. I want to block all weekdays. How do I do that? Is there a shortcut?
Do I need to RESET or SAVE? Finally, is there a simpler way to restrict internet access, i.e. without using this kind of programming? This would be a big advantage if  I want to vary restricted hours on different days. Thanks again
by
In that case, time start would be 01:00 and time stop would be 07:00. If you want to include weekends, add Sat and Sun.

Unfortunately, now there's no functionality to do it in WebUI, only through these commands.

EB.
by
I couldn’t get the instructions to execute. Is this syntax correct? And just to be sure, how do I run the instructions? Is it RESET, then SAVE?

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
#iptables -A INPUT -m time --timestart 01:00 --timestop 07:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j DROP
#iptables -A OUTPUT -m time --timestart 01:00 --timestop 07:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j DROP
exit 0
by

Hi,

First of all, you're putting a comment symbol before the command. Remove '#' before the line that you want to work.

Then what exactly are you trying to reset and save? It should be enough to put the commands in the User Scripts page and restart the router (this one is not necessary, but you can do it to be sure that command executes and will drop the connection by that time you've set).

EB.