Hi guys,
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.
The device is Mikrotik RB2011UiAS-IN and version is Powered by LuCI openwrt-19.07 branch (git-20.053.76840-087e6ac) / OpenWrt 19.07.1 r10911-c155900f66
That doesn't look like a default /etc/config/network -- there's no lan network.
Dual switches is probably beyond what LuCI can handle. It looks like there is the internal AR9344 switch for 5 of the ports (10/100 only), then some sort of external GBe switch on the other CPU port.
And that's a lot of stuff to hang off of an AR9344.
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.
Yes, I did that. I am creating VLANs from scratch so all ports are in off state. The changes from off state to tagged or untagged are not applied no matter if I hit "save" or "save & apply".
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.
So if I understand you correctly you suggest to revert back to firmware defaults and configure VLANs directly in /etc/config/network and not using LuCI?
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."