Second, I use a rooted Homeware (proprietary fork of Openwrt) router for gigabit WAN, it does its job for 20€ in total. Most drivers are proprietary and closed. You cannot rebuild or replace the kernel, nor the main squashfs. It's still some of Openwrt in the end, so everything you compile for userspace works. I run both Transmission (an USB3 SSD is attached for that) and strongswan roadwarrior server on top of it and it just works. Every proprietary driver is integrated into UCI so you always do things the openwrt way, including VLAN and multiple SSID setup. LuCI is working also, but wireless management is not compatible with running wireless drivers. and interface management is not completely compatible because of running vlan drivers, and I think switch vlan management is broken too because of DSA (not sure if latest snapshots could handle this).There exist multiple models with different specs: mine (20€) can do SQM (at ~180Mbps) and has STA capable driver for the 11ac radio; others (20-30€ too) have newer firmwares, quantenna wireless, and hw crypto; I won0t recommend the older ones with older SoC and wireless chipsets, but they may have matched your requirements as well. Depending on what you want from an Openwrt router, this could be a damn cheap solution.
If you want a real Openwrt experience then x86-64 is the way, as someone told here. Leave Rpi4 to makers, it is not meant for networking and it is very expensive for what you get.
do you have a second router that you were using before? hook the pi up to it using the solo onboard device as LAN, then opkg update and install all the needed modules etc.
if not, then it's trickier. you can set up the switch you got to use two VLANs to provide tagged packets for LAN and WAN on say port 1. then config the pi to have LAN on eth0.1 and WAN on eth0.2, put a port untagged in VLAN 2, and hook the WAN cable to that... reboot and plug the pi into port 1, it can talk to LAN and WAN on one port.
OK, since the TP-Link USB2Ethernet dongle driver is working, next step/challenge for me is to configure a router from scratch. I intend to use command line to achieve it, and hope to get some desperately needed help from you guys.
Now I have configured eth0 as br_lan, and eth1 (TP-Link usb dongle) as wan, as following:
I'm not quite sure what you mean with eth1, isn't it plugged into your ISP device (modem/ONT/DSL modem etc?) Does your ISP use multiple VLAN tags to provide multiple services (some tag their IPTV service and internet service separately etc)
Or do you mean you want to make eth0 (LAN side) into a tagged interface, and use other tags for guest/IoT/other networks?
If I were you and I wanted to switch from eth0 to several tagged VLANs, I'd set up something like a lan2 as eth0.2, and change the port to be tagged for vlan 2... then I'd make a second port untagged for 2... connect my laptop to that port, log in from there... and change lan to eth0.1... then change the port to be tagged for both VLAN2 and VLAN1... this way you'll never be locked out... Worst case though you yank the SD card and edit the files manually.