IIRC, LuCI does enforce the limit of one untagged VLAN per physical port for devices that use swconfig (not DSA). I'd have to go back and test to be sure that this is true. However, the same logic should ideally be applied to DSA... so that may be worth a PR.
That said, there is an additional nuance and consideration:
- OpenWrt DSA bridge-vlan syntax has 3 options that are considered valid:
- Tagged (
:t
)
- Untagged (
:u
)
- Untagged + PVID (
:u*
).
- Keep in mind that the
*
(for PVID) really sets the ingress status (i.e. to what VLAN should untagged traffic be assigned as it enters the port), while the t
or u
affect the egress.
- Notice that it is possible to have a port that is marked as untagged, but not PVID.
- There is some precedence for this concept -- some managed switches do this, too, but in order for a network to be considered active on the port as untagged, you must also set the PVID.
- Some switches simply give you the choice of tagged, untagged, or excluded/not-a-member. The PVID is thus implied with any untagged VLAN, and the software/firmware validates that no more than one network is assigned to a port as untagged.
- OpenWrt seems to work differently in this regard, though, in that you can actually have multiple VLANs set for untagged egress, even though only one can be set for untagged ingress.
- this situation is odd and not typically useful, but there was a thread (I can't find it now) where I asked why anyone would ever do this... the answer was a unique, and rather quirky method to perform port isolation with devices on the same subnet using hardware that wasn't designed with port isolation in mind.
So... with that in mind, having multiple VLANs set as untagged on a port may not actually be invalid at the OpenWrt DSA level, although it certainly shouldn't be used under any normal circumstances.
In that thread I referenced, I also remember asking what the difference was between the three ways one could theoretically specify untagged:
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan1:u*'
where the above is explicitly specifying untagged + PVID; vs.
list ports 'lan1:u'
where we specify untagged but not PVID; vs
list ports 'lan1'
where nothing is specified...
AFAIK (and this would require verification), all three should result in the same effect if only a single VLAN is assigned to a port (as untagged). However, IMO, the ports should always be specified exactly to avoid any ambiguity.... so an untagged VLAN on a port should be untagged + PVID (:u*
).
Meanwhile, I'm not sure what data validation currently exists for bridge-VLANs both in LuCI and in UCI syntax...
- In addition to unspecified,
:u
, :u*
and :t
, I think the system will actually allow :t*
(tagged egress, untagged PVID for ingress), which is not valid or any practical use case that I am aware of.
- The system clearly does not prevent the use of unspecified or
:u
on multiple VLANs on a given port.
- I don't know if it validates that only one PVID
*
is specified on a port.
In other words... it's complicated... lol
EDIT: I say all of this based on significant experience with VLANs on both DSA and swconfig for OpenWrt. I almost always directly edit the config files, and I rarely use LuCI or UCI CLI methods to make the changes..