Posted: Wed Nov 24, 2021 11:33 Post subject: [SOLVED] Enable / disable Firewall rule automaticly
Hi all,
i'm looking for a solution to enable or disable a firewall rule automaticly.
I have created a rule on GUI:
Forward src Port 443 to dsc port 443 to a specific IP in my network. The rule is disabled.
If i start a script on my raspberry, the script should open / enable port 443 portforwarding rule - than do some magic stuff - and than close / disable the rule again.
This could be done by SSH or SNMP (i think SNMP is not possible, didnt find anything like that).
I'm not the king of iptables -j NAT SRC DST bla and so on ... (i hate that) - but if someone have a line with a iptables rule wich i can send over ssh to do that, that would be also helpfull maybe _________________ Netgear R7000
Oh, sorry - its a R7000 with r47608
I know how i can create and execute scripts and everything - only iptables i'm not experienced with
so i would need a sample for
Joined: 18 Mar 2014 Posts: 12885 Location: Netherlands
Posted: Wed Nov 24, 2021 13:17 Post subject:
How to make the portforwarding rules is outlined in my earlier post
Place it in a script and then execute that script.
Enabling/Disabling it in the GUI is in theory an option but the portforwarding rules are in one long string in nvram, in theory you can sed on/off in it save and then restart the firewall but just putting the rules in a script and executing seems easier and you do not need to restart the whole firewall