I recently got myself a Xiaomi AX3200 and flashed OpenWRT 22.03 through UART. When I first logged in it surprised me that there is no "Switch" section under the Network Tab. When I SSH into the router I can't even use the swconfig command...
My use case is rather simple, I need to have a tagged VLAN for my IoT devices so that they connect to a wireless network through VLAN ID 20 to my "backend servers". I don't even care if the VLAN is tagged on a LAN interface or the WAN interface of the Xiaomi router, I just don't want two cables going to my switch from the router.
What do I need to do in order to make it working on the Xiaomi device? I already tried setting up a new network device wan.20 and an unmanaged interface on top of that. When I assigned it to the wireless network my devices were not able to connect to any other infrastructure servers in that same VLAN.
Thank you for sharing the DSA Tutorial @trendy - when I do it like that it seems that the router is soft bricked and is no longer available even on it's VLAN 1 default address.
This is all auto generated config from luci... Again when I do the VLAN filtering as suggested in the DSA Mini Tutorial the router will no longer be available and needs to be reset by pressing the reset hardware button.
This should add the wan port to the default bridge and make it use tagged frames with vlan IDs 1 and 20.
The lan ports will remain untagged members of vlan 1.
uci delete network.wan
uci delete network.wan6
uci delete network.@device[1]
uci delete network.@device[2]
uci add_list network.@device[0].ports='wan'
uci add network bridge-vlan
uci set network.@bridge-vlan[-1].device='br-lan'
uci add_list network.@bridge-vlan[-1].ports='wan:t'
uci add_list network.@bridge-vlan[-1].ports='lan1'
uci add_list network.@bridge-vlan[-1].ports='lan2'
uci add_list network.@bridge-vlan[-1].ports='lan3'
uci set network.@bridge-vlan[-1].vlan='1'
uci add network bridge-vlan
uci set network.@bridge-vlan[-1].device='br-lan'
uci set network.@bridge-vlan[-1].ports='wan:t'
uci set network.@bridge-vlan[-1].vlan='20'
uci set network.lan.device='br-lan.1'
uci delete network.wanifvlan20.type
uci set network.wanifvlan20.device='br-lan.20'
/etc/init.d/network restart
If everything is fine, save the changes (uci commit network). Otherwise, reboot the device and the previous configuration will be restored.