Hi all and thanks in advance. I've read a number of articles that are similar but haven't been able to find the solution that I am in search of.
Background:
Using PBR, I want to be able to route some traffic out of a 2nd WG connection while defaulting traffic over WG1. The issue is that the 2nd WG connection uses the WG1 default gateway and I would like it to be out of the WAN interface (not tunnel in a tunnel). I haven't seen a way to specify WG2 VPN to use the ISP WAN interface.
Well there are far more knowledgeable people here but I will give you my two cents (and I am sure someone will correct me if I am wrong)
My idea was to preserve the normal default route via the WAN but override it with the allowed IPs of the WG1 tunnel (This is what OpenVPN is usually doing).
The allowed IPs specified cover every IP but the more specific routes with the /1 netmask will override the default /0 route via the WAN.
Using metrics is the more modern way to do it.
.
So the default route via the WAN is still there so that the endpoint address of the WG server is routed via the existing default route (=WAN).
For the second WG2 tunnel the route allowed IPs is turned off so that no routing at all is made.
This is not needed as there is an extra table created for WG2 by PBR which will have a default route via that tunnel anyway and you can use the PBR package to use that WG2 table by specifying your LAN client to use that WG2 table.
Alternative is to disable route allowed IPs for both tunnels but then you have the main routing table using the WAN as default and you have to specify all clients to use the routing table for WG1 or WG2.