Quote:
Originally Posted by brebs
The *order* of iptables rules is absolutely crucial.
So we can't say whether your DROP/REJECT rule is useful, without seeing the output of "iptables-save", to see whether an earlier ACCEPT takes precedence
|
I'm really not sure what you mean. How would I see the output? You mean if I look at the firewall rules? Either way, it works. I'm blocked off the internet. But I later thought of something better. I was so concerned with my friend's son accessing the neighbour's wifi, that I neglected to think about the fact that I could use iptables to set time restrictions on his own phone. So I can set it so it would boot him off at 11:30pm every night whether he's at home (and trying to use the neighbour's wifi), on vacation, at a friend's house for a sleepover, travelling, etc.
Here is the code I used:
Code:
$IPTABLES -A INPUT -m time --timestart 03:30 --timestop 11:30 --weekdays Sun,Mon,Tue,Wed,Thu,Fri,Sat -j DROP
At first when I was testing it, it wasn't working (I even rebooted my phone). Then I decided to open Android Terminal Emulator and type:
The time was showing in GMT! Even though the time was set to my own timezone in the Android settings, in reality the iptables was using GMT (I guess all Androids use GMT 'internally' no matter the settings?).
So I had to add four hours to the time in my iptable rule to compensate (I'm Atlantic Time in Canada). Worked like a charm.