WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 suddendly stopped to reach the network

Open jonascarfantan opened this issue 4 years ago • 6 comments

Version

10.0.22000.348

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.10.60.1

Distro Version

any Distrib but i use Debian most of the time

Other Software

No response

Repro Steps

sudo ping google.com

Expected Behavior

send paquet to google

Actual Behavior

network unreachable with wsl2 but works fine with wsl1

Diagnostic Logs

Things i have tried wsl --shutdown

ipconfig:

Carte réseau sans fil Wi-Fi :

Suffixe DNS propre à la connexion. . . :

Adresse IPv6. . . . . . . . . . . . . .: 2a04:cec0:1122:96c9:e4c4:5606:68f6:36ea

Adresse IPv6 temporaire . . . . . . . .: 2a04:cec0:1122:96c9:ad16:4324:978b:c5ee

Adresse IPv6 de liaison locale. . . . .: fe80::e4c4:5606:68f6:36ea%7

Adresse IPv4. . . . . . . . . . . . . .: 192.168.43.121

Masque de sous-réseau. . . . . . . . . : 255.255.255.0

Passerelle par défaut. . . . . . . . . : fe80::683f:a2ff:fe5c:72fb%7

192.168.43.1

Carte Ethernet Connexion réseau Bluetooth :

Statut du média. . . . . . . . . . . . : Média déconnecté

Suffixe DNS propre à la connexion. . . :

Carte Ethernet vEthernet (WSL) :

Suffixe DNS propre à la connexion. . . :

Adresse IPv6 de liaison locale. . . . .: fe80::6046:a673:811d:76ac%22

Adresse IPv4. . . . . . . . . . . . . .: 172.17.64.1

Masque de sous-réseau. . . . . . . . . : 255.255.240.0

Passerelle par défaut. . . . . . . . . :
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
Reboot pc a lot of times

Disabled Ipv6 but nor windows nor wsl have reached network without IPv6 Disabled the windows firewall disabled fast boot Uninstall install WSL Upgrade to Windows 11 (and i regret it...)

sudo nano /etc/resolv.conf
Remove line out the nameserver nameserver 17...
add this new line nameserver 8.8.8.8
sudo nano /etc/wsl.conf
Paste the following in

So i can't figure what is happening to my laptop, if you have any idea of what can i try to fix it I will appreciate it.

jonascarfantan avatar Dec 11 '21 22:12 jonascarfantan

I'm having similar problem, which might be related. For me, what helps is to deactivate Windows Firewall. I've submitted it in separate issue on #7823

dckface avatar Dec 12 '21 03:12 dckface

Unfortunately deactivate the firewall doesn't work for me.

jonascarfantan avatar Dec 12 '21 10:12 jonascarfantan

This solution works, but every time wsl is restarted the nameserver is automatically regenerated. seems that the /etc/wsl.conf has no effect.

danchitnis avatar Jan 05 '22 14:01 danchitnis

Have a look at the routing table, @jonascarfantan. Use route print. Make sure the default route for the IP assigned to the network inferface in your Linux distro is to the WSL virtual network adapter in Windows. Make sure the route with the lowest metric moves traffic to WSL virtual network adapter.

I wrote a long post about it https://janovesk.com/wsl/2022/01/21/wsl2-and-vpn-routing.html. In my scenario the route is messed up by a VPN. I don't know if you are running one, but double check the routing table.

janovesk avatar Jan 25 '22 08:01 janovesk

@janovesk, your blog post saved me a ton of pain and suffering (and taught me something in the process). Thank you for the detailed description. I scripted it up here: https://github.com/Codym48/fix-wsl2-vpn

Codym48 avatar Jan 11 '23 04:01 Codym48

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!