What's new

How to disconnect local pc from wifi?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

OK

Now I bought a new router and got an issue with iptables in it. It is an Asus as3200 machine.
I get odd faults when trying to execute the script.

Any ideas?

+ iptables -I dropkids 1 -d 192.168.1.79 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.195 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.195 -j DROP
+ iptables -I FORWARD 1 -m time --timestart 19:30 --days Mon,Tue,Wed,Thu,Fri -j dropkids
iptables v1.4.14: unknown option "--days"
Try `iptables -h' or 'iptables --help' for more information.
+ iptables -I FORWARD 1 -m time --timestop 16:00 --days Mon,Tue,Wed,Thu,Fri -j dropkids
iptables v1.4.14: unknown option "--days"
Try `iptables -h' or 'iptables --help' for more information.
+ test xSat,Sun != x
+ iptables -I FORWARD 1 -m time --timestart 12:30 --days Sat,Sun -j dropkids
iptables v1.4.14: unknown option "--days"
Try `iptables -h' or 'iptables --help' for more information.
+ iptables -I FORWARD 1 -m time --timestop 09:00 --days Sat,Sun -j dropkids
iptables v1.4.14: unknown option "--days"
Try `iptables -h' or 'iptables --help' for more information.
admin@RT-AC3200-7C50:/jffs/scripts#


Michael
 
OK

Now I bought a new router and got an issue with iptables in it. It is an Asus as3200 machine.
I get odd faults when trying to execute the script.

Any ideas?




Michael

iptables -m time -h

so replace --days with --weekdays ?
 
iptables -m time -h

so replace --days with --weekdays ?

This is the result....

admin@RT-AC3200-7C50:/tmp/home/root# /jffs/scripts/firewall-start
+ SchoolNiteTime=19:30
+ SchoolMornTime=16:00
+ SchoolDays=Mon,Tue,Wed,Thu,Fri
+ WeekendNiteTime=12:30
+ WeekendMornTime=09:00
+ WeekendDays=Sat,Sun
+ StaticIPList=192.168.1.25 192.168.1.37 192.168.1.48 192.168.1.79 192.168.1.195
+ MaCList=24:24:0E:7E:DD:1B 40:F0:2F:83:46:BB D0:66:7B:0B:37:0B E8:4E:84:2D:CA:4D 5C:93:A2:17:86:57
+ iptables -N dropkids
iptables: Chain already exists.
+ iptables -F dropkids
+ iptables -I dropkids 1 -m mac --mac-source 24:24:0E:7E:DD:1B -j DROP
+ iptables -I dropkids 1 -m mac --mac-source 40:F0:2F:83:46:BB -j DROP
+ iptables -I dropkids 1 -m mac --mac-source D0:66:7B:0B:37:0B -j DROP
+ iptables -I dropkids 1 -m mac --mac-source E8:4E:84:2D:CA:4D -j DROP
+ iptables -I dropkids 1 -m mac --mac-source 5C:93:A2:17:86:57 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.25 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.25 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.37 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.37 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.48 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.48 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.79 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.79 -j DROP
+ iptables -I dropkids 1 -s 192.168.1.195 -j DROP
+ iptables -I dropkids 1 -d 192.168.1.195 -j DROP
+ iptables -I FORWARD 1 -m time --timestart 19:30 --weekdays
iptables v1.4.14: unknown option "--weekdays"
Try `iptables -h' or 'iptables --help' for more information.
+ Mon,Tue,Wed,Thu,Fri -j dropkids
/jffs/scripts/firewall-start: line 62: Mon,Tue,Wed,Thu,Fri: not found
+ iptables -I FORWARD 1 -m time --timestop 16:00 --weekdays
iptables v1.4.14: unknown option "--weekdays"
Try `iptables -h' or 'iptables --help' for more information.
+ Mon,Tue,Wed,Thu,Fri -j dropkids
/jffs/scripts/firewall-start: line 64: Mon,Tue,Wed,Thu,Fri: not found
+ test xSat,Sun != x
+ iptables -I FORWARD 1 -m time --timestart 12:30 --weekdays
iptables v1.4.14: unknown option "--weekdays"
Try `iptables -h' or 'iptables --help' for more information.
+ Sat,Sun -j dropkids
/jffs/scripts/firewall-start: line 72: Sat,Sun: not found
+ iptables -I FORWARD 1 -m time --timestop 09:00 --weekdays
iptables v1.4.14: unknown option "--weekdays"
Try `iptables -h' or 'iptables --help' for more information.
+ Sat,Sun -j dropkids
/jffs/scripts/firewall-start: line 72: Sat,Sun: not found
 
This is the result....

So does the command

Code:
iptables -m time -h

on your router show the available syntax ?

I have RT-AC56

Code:
ASUSWRT-Merlin RT-AC56U_3.0.0.4 Sat May 30 21:47:01 UTC 2015
admin@RT-AC56U:/tmp/home/root# iptables -m time -h
iptables v1.4.14

Usage: iptables -[ACD] chain rule-specification [options]
       iptables -I chain [rulenum] rule-specification [options]
       iptables -R chain rulenum rule-specification [options]
       iptables -D chain rulenum [options]
       iptables -[LS] [chain [rulenum]] [options]
       iptables -[FZ] [chain] [options]
       iptables -[NX] chain
       iptables -E old-chain-name new-chain-name
       iptables -P chain target [options]
       iptables -h (print this help information)

Commands:
Either long or short options are allowed.
  --append  -A chain            Append to chain
  --check   -C chain            Check for the existence of a rule
  --delete  -D chain            Delete matching rule from chain
  --delete  -D chain rulenum
                                Delete rule rulenum (1 = first) from chain
  --insert  -I chain [rulenum]
                                Insert in chain as rulenum (default 1=first)
  --replace -R chain rulenum
                                Replace rule rulenum (1 = first) in chain
  --list    -L [chain [rulenum]]
                                List the rules in a chain or all chains
  --list-rules -S [chain [rulenum]]
                                Print the rules in a chain or all chains
  --flush   -F [chain]          Delete all rules in  chain or all chains
  --zero    -Z [chain [rulenum]]
                                Zero counters in chain or all chains
  --new     -N chain            Create a new user-defined chain
  --delete-chain
            -X [chain]          Delete a user-defined chain
  --policy  -P chain target
                                Change policy on chain to target
  --rename-chain
            -E old-chain new-chain
                                Change chain name, (moving any references)
Options:
    --ipv4      -4              Nothing (line is ignored by ip6tables-restore)
    --ipv6      -6              Error (line is ignored by iptables-restore)
[!] --proto     -p proto        protocol: by number or name, eg. `tcp'
[!] --source    -s address[/mask][...]
                                source specification
[!] --destination -d address[/mask][...]
                                destination specification
[!] --in-interface -i input name[+]
                                network interface name ([+] for wildcard)
--jump -j target
                                target for rule (may load target extension)
  --goto      -g chain
                              jump to chain with no return
  --match       -m match
                                extended match (may load extension)
  --numeric     -n              numeric output of addresses and ports
[!] --out-interface -o output name[+]
                                network interface name ([+] for wildcard)
  --table       -t table        table to manipulate (default: `filter')
  --verbose     -v              verbose mode
  --line-numbers                print line numbers when listing
  --exact       -x              expand numbers (display exact values)
[!] --fragment  -f              match second or further fragments only
  --modprobe=<command>          try to insert modules using this command
  --set-counters PKTS BYTES     set the counter during insert/append
[!] --version   -V              print package version.

time match options:
    --datestart time     Start and stop time, to be given in ISO 8601
    --datestop time      (YYYY[-MM[-DD[Thh[:mm[:ss]]]]])
    --timestart time     Start and stop daytime (hh:mm[:ss])
    --timestop time      (between 00:00:00 and 23:59:59)
[!] --monthdays value    List of days on which to match, separated by comma
                         (Possible days: 1 to 31; defaults to all)
[!] --weekdays value     List of weekdays on which to match, sep. by comma
                         (Possible days: Mon,Tue,Wed,Thu,Fri,Sat,Sun or 1 to 7
                         Defaults to all weekdays.)
    --kerneltz           Work with the kernel timezone instead of UTC
admin@RT-AC56U:/tmp/home/root#

or did you add a LF after the --weekday clause... :eek:

PEBKAC!
 
Last edited:
I have an RT-AC3200 using firmware 380.63_2 when I look at the iptables man page, it looks like the days option is missing. Im trying to use the script in post #12 above.

What can I use in place of the --days option?
 
Hi Colin, can you think of any reason why this script doesn't re-enable? It drops fine with the SchoolNiteTime and WeekendNiteTime, but then it doesn't re-enable with the SchoolMornTime or the WeekendMornTime.
 
Hi Colin, can you think of any reason why this script doesn't re-enable? It drops fine with the SchoolNiteTime and WeekendNiteTime, but then it doesn't re-enable with the SchoolMornTime or the WeekendMornTime.
I will reply in your other thread.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top