PBR Policy "Not Working"

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.

  1. 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).
  2. 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.

Solution 2 is OK as long as you have IPv6 (subnets) on the WAN and WG. Alternatively, you could configure the Local Network not to assign IPv6 addresses.

1 Like

Have you checked the suggestion from the README?

2 Likes

I did, thanks. If i understood correctly, that's if my VPN allows IPv6, in which mine doesn't. But by simply enabling ipv6 support on pbr, it seems to exclusively use ipv4 via the vpn (when pbr policy is active), which would be the solution in my case. And when the pbr policy is disabled, the device continues having ipv6 when using wan directly (again, the ideal solution in my case).

Wasn't sure if this was the intended behavior, but in my case it seems to work well.

1 Like