I need to setup two different VPN services one on top of the other.
So here is how it should be:
Now I can easily achieve this by adding the two vpn interfaces and the editing the routes with a bash script:
ip route del <wireguard_server> dev eth0.2 ip route add <wireguard_server> dev openvpn ip route del 0.0.0.0/0 dev openvpn_if ip route add 0.0.0.0/0 dev wireguard_if
So the script delete the route that gets created automatically when openwrt tries to bring up the wireguard interface and change it to make the connection happen through OpenVPN. Then change the default route to Wireguard.
This actually works but I would like to understand how to do it via Luci or al least via /etc/config/network