Answer the question
In order to leave comments, you need to log in
Disable internet on OpenWRT schedule?
The crux of the matter is that there is such a scheme for connecting a computer to the Internet
, you need to block access to the Internet at the address
192.168.
iptables -A INPUT -s 192.168.1.52 -m time --localtz --timestart 08:00:00 --timestop 11:00:00 -j DROP
Answer the question
In order to leave comments, you need to log in
Is the time in OpenWrt set to Moscow (+3 hours), or do you still need to add it ??
indicated without seconds - there is little
point even if you do not specify the time, the traffic does not block
, maybe some modules need to be installed, now it is only iptables-mod-ipopt to use -m time
The -A INPUT option adds a rule to the end of a chain of existing rules. If ACCEPT has already been applied to this type of traffic in this chain, then the traffic is not processed further and does not reach your rule.
In addition, transit traffic is processed in the FORWARD chain, and in the INPUT chain, only traffic addressed directly to the router itself.
Apparently, instead of "-A INPUT" you need to write "-I FORWARD 1".
This will most likely work, but it's not correct. the OpenWRT firewall has its own rule chain structure. You can see it if you go to the console and write iptables -t filter -L -n -v
The chain you are interested in is probably called forwarding_lan_rule. I recommend reading the documentation on iptables and studying the structure of the openwrt firewall. Well, or try to configure the desired rule through the web interface (not the fact that this is possible).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question