I'm writing here since I couldn't find my problem in the existing posts, and wanted to share my problem and solution in case it helps anyone else save some time.
My setup is a WAN, and a VPN client (Wireguard), with some device specific policies to use the VPN. Everything was "set up" correctly, but I was having weird behavior on the devices that had a policy to use the VPN. Sometimes they used the VPN, but most of the times they were using WAN.
The issue was that these devices had a IPv6 assigned, and when the device communicated with IPv6, it bypassed the PBR policy and used wan. So I found two fixes.
- Disable IPv6 in the network of those devices with PBR policies (in my case, the lan network, which I can disable by disabling "Delegate IPv6 prefixes" in the wan6 interface under Advanced Settings).
- Enable "IPv6 Support" in PBR.
However, I'm interested to know if (2), enabling ipv6 support in PBR, is in fact the correct solution for my case? Doing tests on my devices makes me think everything is in order, but just wanted to check since I'm still a fairly novice user.