I am having issue with configuration of the Switch VLANs using a web interface.
Basically I have two issues:
When I try to add new VLAN under Switch 0 in UI is added new VLAN 1 under switch 0 and switch 1. But commands for uci are generated for switch 1 only. Then after hit Save & Apply the configuration is written only for switch 1 into /etc/config/network.
Second issue is if I want to change port definition from off to tagged or untagged under switch 1 it is reset back to off.
If you want to set a VLAN to untagged on a specific port, you must first make sure that all other VLANs are set to off or tagged for that port. This is because you cannot have multiple untagged networks on a single switch port.
Can you either verify that you have already done this? If you haven't, try ensuring that the switchport has no untagged VLANs before you try to assign the VLAN of interest as untagged (I'm pretty sure that you can apply the settings after you do both operations, but it is possible you'll need to apply between). Please report back with your status.
Usually you keep lan as the administrative network, and launch a wifi AP on it. Since you have a console port there isn't as much concern about losing access but when there isn't one its typical to log in to lan via wifi while configuring ethernet.
The firstboot scripts try to build out a default switch configuration which has all the external ports in the switch untagged in one VLAN-- that's usually a good place to work from. Between that and running swconfig help and swconfig show you can deduce the hardware topology and configure the switch in /etc/config/network.
Like I said don't expect LuCI to handle this situation.
Ports that aren't configured stay in VLAN0. That's a dead end not a third VLAN. Valid VLAN numbers start at 1.
Ultimately the configuration is all stored in /etc/config/network. LuCI and uci are only indirect means to edit that file. I suggest starting with a default configuration and make small changes at a time rather than hacking it all to pieces and trying to "build from scratch."