Disclaimer: This guide is based on Linksys EA8100 router. The configuration and steps may varies depends on the router hardware and brands.
If you haven't had any experience with OpenWRT, this blog might be a good start. I am also a newbie to OpenWRT. I did a lot of googling around how to do a proper setup with OpenWRT for TM Unifi (one of Malaysia's ISP providers) but was not able to find one during the time I wrote this blog, especially for the version of OpenWRT with DSA.
First, you will need to go to the OpenWRT website to check if your router is supported by OpenWRT. It is important to make sure the router has adequate support for its hardware. You can go to this link, https://firmware-selector.openwrt.org/ where you can check your router model. If it is on the list, then you are good to download the firmware for your router brand and model.
Once you download the firmware for your router, you will need to upload the firmware to your router. For linksys brand, especially for model EA8100 (since I am using this brand and model) it is quite easy. You just need to go to Linksys WebUI page and then under Router Settings, go to Connectivity, then under Router Firmware Update, click on Choose File button under Manual section and select your openwrt image, and click Open button. After that, click the Start button next to start the flash image process. Once completed, the router will automatically reboot. Do not manually reboot the router even it seems like the flash has been completed, as it can brick your router. You can also search the video guide on YouTube on how to do this process.
Once the router is successfully back online after a reboot, you should be able to login to your OpenWRT UI or LuCI. It uses the same IP address as your original Linksys WebUI login page.
The first step it will ask you to do is it to setup the login password. Then go to Network > Interface. Click on Devices tab. Click on Add Device Configuration. Device type, select VLAN (802.1q). Base Device, select wan. VLAN ID, type 500. Device name, you can put anything that would make it easier for you to identify the WAN connection for VLAN ID 500 for TM Unifi, example UniFi.500. Then click Save button.
Next, go to Interfaces tab. Select wan interface and then click Edit button. Change the protocol type from DHCP client to PPPoE. Then you will need to enter userid and password for TM Unifi and click Save button.
Next, you can configure the wifi for the router. This configuration may vary depending on your requirements and needs.