-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Wsl2 support for generated configs #14678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Technical ReviewThank you for this PR addressing WSL2 compatibility. I've analyzed the changes and their implications: What This Change DoesThe PR modifies the WireGuard
Breaking down the changes:
Why This Helps WSL2WSL2 has known networking quirks due to its virtualized network stack. This split routing approach is a documented workaround in the WireGuard community that helps avoid conflicts with WSL2's internal networking. Concerns
RecommendationWhile this fix helps WSL2 users, applying it globally would break IPv6 VPN functionality for everyone else. Instead, consider:
This way, WSL2 users get the fix they need without impacting other users' VPN functionality. |
dguido
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Thank you for working on WSL2 compatibility! Unfortunately, this PR introduces a critical security issue that prevents merging in its current form.
🚨 Critical Issue: IPv6 Leak
The change from ::/0 to ::/128 breaks IPv6 routing through the VPN:
| Original | Proposed | Effect |
|---|---|---|
::/0 |
::/128 |
All IPv6 traffic leaks outside VPN |
::/128 only routes the single unspecified address ::, not all IPv6 traffic. This defeats Algo's privacy guarantees for any user on an IPv6-capable network.
The IPv4 Change is Fine
The 0.0.0.0/0 → 0.0.0.0/1, 128.0.0.0/1 split is a well-known technique and functionally equivalent.
Suggested Fix
If you want to use the split-routing approach for both protocols, the IPv6 equivalent would be:
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1, ::/1, 8000::/1
This covers all IPv6 addresses using the same split technique.
Additional Concerns
-
Affects all users - This changes every generated client config, not just WSL2 deployments. Consider making this opt-in via a config option.
-
Root cause - Per the linked WSL issue, the original reporter found the actual fix was applying DNS config to the WireGuard server interface, not this client-side workaround.
-
DNS change mentioned but not included - You noted DNS needs to change to
1.1.1.1, but that's not in this PR.
Path Forward
I'd suggest one of these approaches:
- Fix the IPv6 routing in this PR using
::/1, 8000::/1 - Add a configuration option (e.g.,
wsl2_compatible) so users can opt-in - Document in the wiki as a manual workaround for WSL2 users
Happy to help iterate on this if you'd like to continue working on it!
Closing: IPv6 routing brokenThank you for identifying this WSL2 compatibility issue. After researching the root cause, I'm closing this PR because the proposed change would break IPv6 VPN routing for all users. The Problem with This PRThe PR changes to: The IPv6 part is incorrect. The Correct Split-Route ApproachPer the official WireGuard Windows documentation, the correct way to avoid the Windows kill-switch while maintaining full coverage is:
Root CauseThe underlying issue is that WireGuard for Windows enables restrictive firewall rules (the "kill-switch") when Next StepsI'm filing a separate issue to properly address WSL2 compatibility, which may include:
Thank you for bringing this to our attention! |
By default generated configs does not allow WSL2 to access network with wireguard enabled. So here is the quick fix for it: microsoft/WSL#7895 (comment)
I guess DNS server must be changed too to 1.1.1.1, does not work without it for me.