Skip to content
  • Thomas Haller's avatar
    wireguard: support configuring policy routing to avoid routing loops · 10e05bf8
    Thomas Haller authored
    For WireGuard (like for all IP-tunnels and IP-based VPNs), the IP addresses of
    the peers must be reached outside the tunnel/VPN itself.
    
    For VPN connections, NetworkManager usually adds a direct /32 route to
    the external VPN gateway to the underlying device. For WireGuard that is
    not done, because injecting a route to another device is ugly and error
    prone. Worse: WireGuard with automatic roaming and multiple peers makes this
    more complicated.
    
    This is commonly a problem when setting the default-route via the VPN,
    but there are also other subtle setups where special care must be taken
    to prevent such routing loops.
    
    WireGuard's wg-quick provides a simple, automatic solution by adding two policy
    routing rules and relying on the WireGuard packets having a fwmark set (see [1]).
    
    Let's also do that. Add new properties "wireguard.ip4-auto-default-route"
    and "wireguard.ip6-auto-default-route" to enable/disable this. Note that
    the default value...
    10e05bf8