How do i set default route to br-lan?

hi

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

any idea please?

tried curl --interface ?

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.

iirc, yes, with --interface vpn switch
only vpn interface works, br-lan doesnt. it seems like an invalid option

shouldn't interface be WAN, in this case ?

you are right

but is pbr the only solution?

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

config route
	option interface 'wg_mullv_se'
	option table '102'
	option target '0.0.0.0/0'

config rule
	option src '192.168.30.0/24'
	option lookup '102'

it didnt work until i disable the option below:
option route_allowed_ips

thanks for you help