Add new redirect section to firewall config
it'll be latest in list of redirects sections
uci add firewall redirect
- this will return you your new section name, for example - cfgca3837
.
Then you should use that new section name for setting its attributes:
uci set firewall.cfgca3837.name='ssh to lan'
uci set firewall.cfgca3837.target=DNAT
uci set firewall.cfgca3837.src=wan
uci set firewall.cfgca3837.dest=lan
uci set firewall.cfgca3837.proto=tcp
uci set firewall.cfgca3837.dest_ip=192.168.0.110
uci set firewall.cfgca3837.src_dport=2222
uci set firewall.cfgca3837.dest_port=22
Commit changes to firewall config
uci commit firewall
Revert changes to firewall config
uci revert firewall
Enable section 2 of redirects
uci set firewall.@redirect[2].enabled=1
Disable section 2 of redirects
uci set firewall.@redirect[2].enabled=0
Reorder section, but it doesn't work well from CLI
uci reorder firewall.cfgca3837=2
Show your new config section
uci show firewall.cfgca3837
Show pending changes in firewall config
uci changes firewall
Show section 2 of redirects in firewall config
uci show firewall.@redirect[2]
Show all firewall config
uci show firewall
Reload firewall rules, it doesn't reload custom rules (/etc/firewall.user)
fw3 reload