i have finally set up openwrt 23.05 with multiple network interfaces. however when i executed "curl api.ipify.org" i found that by default the traffic went through the vpn interface instead of br-lan
i have tried to set metrics as mentioned in this forum but then no traffic would go thur the vpn interface. i have aslo tried to put the br-lan config to the bottom of network config file but it didnt help neither
i need to manually add a default gw to 192.168.1.1 in order to make it work but this is not an ideal solution
That depends on the setup of the VPN client, most setup instructions for WireGuard or OpenVPN assume you want to have default routing via the VPN.
So learn how to properly setup your VPN client.
Of course if you do not have default routing via the VPN you need something like Policy Based Routing to route clients/interfaces/destinations of your choice via the VPN.
You need some form of PBR, you can install the whole package (recommended):
Or if you have simple needs do the same thing manually, this is an example to route a subnet via the wg_mullvad_se interface.
First creating a routing table 102 with default routing via the WG interface, next creating a rule to let subnet 192.168.30.0/24 use that table:
/etc/config/network