Skip to content

Instantly share code, notes, and snippets.

@vyach-vasiliev
Created December 12, 2024 20:57
Show Gist options
  • Save vyach-vasiliev/2646e90d8ce087b858db592ff9118e47 to your computer and use it in GitHub Desktop.
Save vyach-vasiliev/2646e90d8ce087b858db592ff9118e47 to your computer and use it in GitHub Desktop.
WSL 2 Internet connection doesn't work until I connect to VPN

Author: @wushangwei
Source: microsoft/WSL#5784 (comment)

I once had the opposite problem: WSL2 lost internet connection when connected to WIreGuard VPN.

I solved the problem by editing the "AllowedIPs“ field of WireGuard conf:

[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Address = 10.88.88.2/24
DNS = 1.1.1.1

[Peer]
PublicKey = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
PresharedKey = zzzzzzzzzzzzzzzzzzzzzzzzzzzzz
AllowedIPs = ::/128, 0.0.0.0/1, 128.0.0.0/1
Endpoint = xxx.xxx.xxx.xxx:xxxxx

Hope it will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment