not sure this question should placed in "For Developers".
I'm using OpenWRT for around 3 weeks and struggle with uci set. I want to change
the firewall forwarding between two zones with uci.
As the type / section is unnamed the struggle for me is to change an option in unnamed configs.
At the moment I have only one forwarding setting, but it could be that some more will come. To access this forwarding setting better I gave the type a name.
In /etc/config/firewall I changed:
option src 'lan'
option dest 'wan'
When there are multiple rules next to each other, UCI supports array-like references for them. If there are 8 NTP servers defined in /etc/config/system , UCI will let you reference their sections as system.@timeserver for the first or system.@timeserver for the last one. You can also use negative indexes, such as system.@timeserver[-1] . “-1” means the last one, “-2” means the second-to-last one, and so on. This comes in very handy when appending new rules to the end of a list. See the examples below.
In a clean installtion forwarding will be lan->wan
That was the documentation I found. I understand that unnamed sections could
be accessed with the array-like syntax.
I struggle with finding the right index to access the specific configuration which I want
to change. Thats why I want to know if it have side effects if I name it.
It is right, that in the clean installation the index would be 0, but what if for some reason
the index change, ex. a new forwarding rule or such.