So I had a very bad written post, so I edit it to be easier to understand, with the configs attached configured in the way I think it should be.
I have a APU router running OpenWRT 22.03 and a Netgear GS108Ev3.
I've had my VLAN setup working exactly as I want it to work, but after some tinkering I blew my whole configuration up and I locked me out and had to factory reset the router. Unfortunately I didn't have it backed up.
My router got three ports, one WAN and two LAN. I want to connect the first LAN port (eth1) to my switch and from there have my wired devices connected to different VLANs.
The second LAN port I don't need to use at this point.
Here I will just mention VLAN 30 as I get that working, it will be no problem to fix the rest of them.
What I'm trying to do is to have VLAN1 for my router, switch and stuff like that and then have VLAN30 for my trusted devices.
At this point WiFi works as expected. My devices connected to WiFi are on the right VLAN (VLAN 30).
I have no idea if it's configured wrong on the router or on the swich (or both?).
/etc/config/dhcp
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix '***'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
list ports 'eth2'
option bridge_empty '1'
option ipv6 '0'
config device
option type 'bridge'
option name 'bridge'
option bridge_empty '1'
option ipv6 '0'
list ports 'bridge.1'
list ports 'eth1'
list ports 'bridge.30'
config bridge-vlan
option device 'bridge'
option vlan '1'
list ports 'bridge.1:t'
list ports 'bridge.30'
config bridge-vlan
option device 'bridge'
option vlan '30'
list ports 'bridge.1'
list ports 'bridge.30:t'
list ports 'eth1:t*'
config interface 'trst'
option proto 'static'
option device 'bridge.30'
option ipaddr '192.168.30.1'
option netmask '255.255.255.0'
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd99:bafc:8772::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
config interface 'wan'
option device 'eth1'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
config interface 'guest'
option proto 'static'
option device 'eth2.3'
option ipaddr '10.10.10.1'
option netmask '255.255.255.0'
config interface 'iot'
option proto 'static'
option ipaddr '10.20.20.1'
option netmask '255.255.255.0'
option device 'br-iot'
config device
option type 'bridge'
option name 'br-iot'
list ports 'eth2.4'
i have 3 physical network interface: eth0, eth1, eth2.
eth1 is wan, simple standard config
eth0 is member of the br-lan bridge device, which is assigned with interface lan. standard config.
eth2 is shared port between guest and iot networks. vlans are created automatically because i am using the eth2.x notation. they are almost the same, there is slight difference though: iot interface is assigned to a br-iot bridge device which has eth2.4 as member (like in case of lan), while guest network is directly assigned to eth2.3 device. creating an extra bridge device for iot is just more comfortable for me but not necessary at all. unless you do wifi, because wifi needs a bridge device to tap on to.
now, my switch port which connects to eth2 is configured as trunk port, so both VLANs (3, 4) can pass through. then switch does the heavy lifting by cascading VLANs further down by assigning some ports to one or the other vlan.
in short, if your switch is manageable and supports vlans you should just define your vlans with eth.X notation, and connect to trunk switch port.
your configuration with 'bridge' bridge and bridge.X mixed with eth is too complicated, least to say, in my opinion. (and apparently does not work).