[Solved] Switch and Bridge Config (UCI) Parameters

Maybe it's on the OpenWRT Wiki somewhere, but I haven't been able to find clear descriptions of several UCI parameters that LuCI seems to use liberally. I've got a non-trivial switch and bridge config underway and need to hand-edit the config.

Bridges

Not defined in the UCI Network Wiki page, but used by LuCI or device "starter" config include:

_orig_ifname

Appears to be a list of "real" (non-UCI-ified) links. Is there a reason the ifname option can't be used for these? It appears that both _orig_ifname and ifname can appear for the same bridge and the bridge forms over the union of the two. Is this correct?

_orig_bridge

Nothing obvious on this one, as on my router lan has it 'true' and wan has it 'false'

Switch

vlan and vid

Not at all clear from the VLAN Wiki page, but it seems as though vlan is perhaps a hardware index to a configuration "slot" and has nothing to do with the VLAN tag. Not called out on that page is that it appears that the actual VLAN tag is required to be set by vid (with some default?) . Are these correct understandings?

You might take a look at the OpenWrt UCI System wiki page...

https://wiki.openwrt.org/doc/uci

https://openwrt.org/docs/user-guide/base-system/uci is the replacement for the page you linked, which is clearly marked

This wiki is read only and for archival purposes only. >>>>>>>>>> Please use the new OpenWrt wiki at https://openwrt.org/ <<<<<<<<<<

https://openwrt.org/docs/user-guide/base-system/uci then links to

/etc/config/network Switch, interface and route configuration

Note that on https://openwrt.org/docs/user-guide/network/basics there only a very cursory discussion of switch configuration at all. The VLAN page is somewhat better, and can be found through search.

The page I posted does not match any of the pages in the links you posted.

Post order got a little twisted there. While I understand the newb treatment, I had already pursued the page you suggested, they took me to the page I posted in the lead, and failed to describe VLANs and switch configuration in any meaningful way.

Haven't seen any posts that treat you like a "newb"...

This thread should probably be moved to the Documentation forum.

No, this is a technical question.

At least what I can tell from the source code, _orig_bridge and _orig_ifname are both LuCI-isms, appearing only in

./feeds/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua

but not anywhere else in the code that fgrep -rI _orig_bridge <root of LEDE git tree> could find.

I dont want to open new thread for this.
Isnt the vlan id / vid 1 somewhat reserved and the default vlan on most switches?
I dont remember my default network config for my device (mvebu).
But i think one vlan was ethx.1 (and i guess this also the case for other platforms)
Wouldn't it better to start by 2 or even 10 ?

Yes, very often the default configuration chooses to use low-numbered VLANs to manage the connection between the internal Ethernet interfaces and the physical ports on the unit. With two Ethernet interfaces in the device, the default configuration is usually not "VLAN-aware" in that untagged packets are accepted into the switch and untagged packets are delivered out of it. In that case, VLANs are only used internally in the switch to, for example, connect one eth device to the "LAN" ports and another eth device to the "WAN" port. When there is only a single Ethernet interface in the unit, many configurations use VLANs on that interface to split LAN from WAN traffic to/from the switch, such as eth0.1 and eth0.2. This is just one way to configure a switch, one that works well for many users in single-router home/SOHO use.

https://openwrt.org/docs/user-guide/network/basics#switch_configuration has been added.

It appears that at least the AR8327 driver only supports 128 VLANs. vid must be declared to create VLANs with tags over 127.

# swconfig dev switch0 help
switch0: ag71xx-mdio.0(Atheros AR8327), ports: 7 (cpu @ 0), vlans: 128
     --switch
	Attribute 1 (int): enable_vlan (Enable VLAN mode)
	Attribute 2 (none): reset_mibs (Reset all MIB counters)
	Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX packets)
	Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX packets)
	Attribute 5 (int): mirror_monitor_port (Mirror monitor port)
	Attribute 6 (int): mirror_source_port (Mirror source port)
	Attribute 7 (int): arl_age_time (ARL age time (secs))
	Attribute 8 (string): arl_table (Get ARL table)
	Attribute 9 (none): flush_arl_table (Flush ARL table)
	Attribute 10 (int): igmp_snooping (Enable IGMP Snooping)
	Attribute 11 (int): igmp_v3 (Enable IGMPv3 support)
	Attribute 12 (none): apply (Activate changes in the hardware)
	Attribute 13 (none): reset (Reset the switch)
     --vlan
	Attribute 1 (int): vid (VLAN ID (0-4094))
	Attribute 2 (ports): ports (VLAN port mapping)
     --port
	Attribute 1 (none): reset_mib (Reset single port MIB counters)
	Attribute 2 (string): mib (Get port's MIB counters)
	Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode)
	Attribute 4 (none): flush_arl_table (Flush port's ARL table entries)
	Attribute 5 (int): igmp_snooping (Enable port's IGMP Snooping)
	Attribute 6 (int): pvid (Primary VLAN ID)
	Attribute 7 (unknown): link (Get port link information)