Posted: Thu Feb 02, 2017 18:53 Post subject: Change Access Policies using ssh
I am wondering if it is possible to enable or disable an access policy that has already been created with an SSH command? I have 8 different access policies setup with the DDWRT GUI but I would like to be able to enable or disable them easily with ssh from my phone.
Is it possible to change access policy settings with ssh?
There's an android app (DD-WRT Companion) that can do this through ssh. However I would love to know how to do this manually so I'm able to create simple homescreen shortcuts that disable/enable policies.
I figured I could just check what commands the app was sending to the roku and here's what I found
/usr/sbin/nvram set filter_rule4="\$STAT:1\$NAME:Roku\$DENY:1\$\$" && /sbin/stopservice firewall && /sbin/startservice firewall
That command changes rule 4 with the name Roku to STAT:1 (enabled) and then restarts the firewall.
I tried this and it works! Really nice.
I issued this over ssh:
/usr/sbin/nvram set filter_rule4="\$STAT:MyRuleNr\$NAME:MyPolicyName\$FILTER:1\$\$" && /sbin/stopservice firewall && /sbin/startservice firewall
But how can you accept network traffic again? I assume you have to change 'DENY'into something like 'ACCEPT', or 'FILTER'? I cannot get it working.
I would like to issue these commands from my Domotica server.