What's new

Time based rule to not allow LAN access to a device

  • 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!

What would be the best way to stack 4 addresses (say 192.168.81.180, 192.168.81.185, 192.168.81.192, 192.168.81.200)?

Would I just create the 2 lines 4 times (with the addresses), or is there a way to combine the addresses in the 2 lines?


iptables -I INPUT -i br0 -s 192.168.81.180 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 22:00 --timestop 00:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT
iptables -I INPUT -i br0 -s 192.168.81.180 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 00:00 --timestop 08:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT

Code:
iptables -I INPUT -i br0 -s 192.168.81.180,192.168.81.185,192.168.81.192,192.168.81.202 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 22:00 --timestop 00:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT
iptables -I INPUT -i br0 -s 192.168.81.180,192.168.81.185,192.168.81.192,192.168.81.202 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 00:00 --timestop 08:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT
 
Code:
iptables -I INPUT -i br0 -s 192.168.81.180,192.168.81.185,192.168.81.192,192.168.81.202 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 22:00 --timestop 00:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT
iptables -I INPUT -i br0 -s 192.168.81.180,192.168.81.185,192.168.81.192,192.168.81.202 -p tcp -m multiport --dports 139,445,8200 -m time --timestart 00:00 --timestop 08:00 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz -j REJECT
Thanks!
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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