- Enable script execution
reg add HKLM\Software\WireGuard /v DangerousScriptExecution /t REG_DWORD /d 1 /f
Source: https://github.com/WireGuard/wireguard-windows/blob/master/docs/adminregistry.md
- Add PostUp script into Interface section
[Interface]
PrivateKey = ...
Address = ...
PostUp = powershell.exe -command "Set-NetIPInterface -InterfaceAlias '%WIREGUARD_TUNNEL_NAME%' -InterfaceMetric 5000"