Consult this section of the docs:
http://netjsonconfig.openwisp.org/en/stable/backends/openwrt.html#all-the-other-settings

The following NetJSON:

{
    "firewall": [
        {
            "config_name": "zone",
            "config_value": "wan",
            "name": "wan",
            "output": "ACCEPT",
            "input": "REJECT",
            "forward": "REJECT",
            "network": ["wan", "wan3g"]
        }
    ]
}

Produces:

package firewall

config zone 'wan'
option forward 'REJECT'
option input 'REJECT'
option name 'wan'
list network 'wan'
list network 'wan3g'
option output 'ACCEPT'

I hope it helps.

On Thu, Apr 27, 2017 at 4:00 PM henriqsc <[email protected]> wrote:

> Hi Federico thanks for the links. I'm looking for something like:
>
> {
> "zone": [
> {
> "output": "ACCEPT",
> "input": "REJECT",
> "forward": "REJECT",
> "name": "wan"
> "network": "wan wan3g"
> }
> ]
> }
>
> To get something like:
>
> config zone 'rule_name_here'
>         option output 'ACCEPT'
>         option name 'wan'
>         option input 'REJECT'
>         option forward 'REJECT'
>         option network 'wan wan3g'
>
> Aparently I need the correct key for "zone".
>
> As a rule I always test via uci configuration, then check the changes
> where applied on the Openwrt UI, then I create the json and test via
> netjsonconfig command line then if everything looks ok I create the
> template via advanced mode, apply it to the device and test again to have
> an "approved" template.
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to