Re: [openwisp] Openwrt Backend

2017-08-29 Thread henriqsc
Right, the following json did it for me. { "firewall": [ { "config_name": "rule", "config_value": "SSH_WAN", "proto": "tcp", "dest_port": "22", "target": "ACCEPT", "src": "wan" } ] } -- You received th

Re: [openwisp] Openwrt Backend

2017-08-29 Thread henriqsc
{ "firewall": [ { "config_name": "rule", "config_value": "SSH_WAN", "proto": "tcp", "dest_port": "22", "target": "ACCEPT", "src": "wan" } ] } -- You received this message because you are subscribed to

Re: [openwisp] Openwrt Backend

2017-08-29 Thread henriqsc
Right, the following json did it for me. { "firewall": [ { "config_name": "rule", "config_value": "Acesso_SSH_from_WAN", "proto": "tcp", "dest_port": "22", "target": "ACCEPT", "src": "wan" } ] } -- Yo

Re: [openwisp] Openwrt Backend

2017-08-29 Thread Federico Capoano
After investigating this for a while, I found out there's a misunderstanding: you are trying to use the policy routing feature (ip rule) instead of the firewall feature (which is basically a wrapper to iptables), but the firewall feature is not supported in netjsonconfig yet (you can use the

Re: [openwisp] Openwrt Backend

2017-08-28 Thread Federico Capoano
I think it happens again because the logic of that part hasn't changed. I will follow up on this when I have some spare time. Federico On Mon, Aug 28, 2017 at 6:33 PM henriqsc wrote: > Ok: https://github.com/openwisp/netjsonconfig/issues/96 > > But I'm not sure it's happening in newer versions

Re: [openwisp] Openwrt Backend

2017-08-28 Thread henriqsc
Ok: https://github.com/openwisp/netjsonconfig/issues/96 But I'm not sure it's happening in newer versions since renderes.py is no more a file, it's now renamed to renderer.py which is a much smaller file. -- You received this message because you are subscribed to the Google Groups "OpenWISP" g

Re: [openwisp] Openwrt Backend

2017-08-28 Thread Federico Capoano
Ok I see, it's bug! Could you open an issue here by copying/and pasting your last email? https://github.com/openwisp/netjsonconfig/issues Federico On Monday, August 28, 2017 at 5:17:26 PM UTC+2, henriqsc wrote: > > Hi Federico > > { > "ip_rules": [ > { > "src":"wan", > "enabled":"1", > "proto":"

Re: [openwisp] Openwrt Backend

2017-08-28 Thread henriqsc
Hi Federico { "ip_rules": [ { "src":"wan", "enabled":"1", "proto":"tcp", "dest_port":"22", "target": "ACCEPT" } ] } I think it's happening because I'm using an older version of netjsonconfig where there is still a file called renderers.py which calls ip_network for that property (src) genratin

Re: [openwisp] Openwrt Backend

2017-08-28 Thread Federico Capoano
According to the schema any string should be allowed: https://github.com/openwisp/netjsonconfig/blob/871c1263117e5db38ed597ebda24e6c88b123a43/netjsonconfig/backends/openwrt/schema.py#L239-L244 Could you share an example NetJSON configuration that triggers the error you are getting? Federico On M

[openwisp] Openwrt Backend

2017-08-28 Thread henriqsc
Hello I think the openwrt backend has a small problem related to the validation of option "src" in the ip_rules dictionary. According to Openwrt documentation (https://wiki.openwrt.org/doc/uci/firewall) option src is supposed to be a zone but the backend requires the value to be an octet. Am I