Skip to content
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

No internet access before #6939

Closed
1 of 2 tasks
luis-arch opened this issue May 12, 2021 · 4 comments
Closed
1 of 2 tasks

No internet access before #6939

luis-arch opened this issue May 12, 2021 · 4 comments
Labels

Comments

@luis-arch
Copy link

Windows Build Number

Microsoft Windows [version 10.0.19042.985]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.32

Distro Version

kali-linux,aipine

Other Software

Docker Desktop (Windows),version 3.2.2
Visual Studio Code 1.54.3 with Remote-wsl Extension 0.546
v2rayN,version4.17

Repro Steps

after use v2ray's global proxy,my wsl2 network doesn't work.

i want to install alpine-pkg-glibc in my wsl2 alpine.

so i did

wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk
apk add glibc-2.33-r0.apk

then i got

wget: bad address 'alpine-pkgs.sgerrand.com'

Expected Behavior

I think this is a problem that occurred in alplin alone, but I also had a similar problem in kali-linux afterwards.

Actual Behavior

I found that I can ping the ip of the virtual machine, but ping the external host or even the local computer will show "ping: sendto: Network unreachable"

i use "# ifconfig", and it display nothing

i use "#ifconfig eth0", and it just show

eth0      Link encap:Ethernet  HWaddr 00:15:5D:D8:2B:AA
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I found that eth0 is missing inet and inet6, which may be the cause of the problem

windows cmd ipconfig show

`Windows IP Configuration


Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : home
   Link-local IPv6 Address . . . . . : fe80::edd5:b664:f65f:1a8e%27
   IPv4 Address. . . . . . . . . . . : 192.168.104.180
   Subnet Mask . . . . . . . . . . . : 255.255.255.192
   Default Gateway . . . . . . . . . : 192.168.104.190


Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe40::34a8:9102:1910:c0c2%30
   IPv4 Address. . . . . . . . . . . : 172.21.48.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::19b8:9766:bd3:f15d%90
   IPv4 Address. . . . . . . . . . . : 172.25.64.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . 

I use stackoverflow

netsh winsock reset 
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

cann't solve my problem.

i also check #4342, #4275,
#5286

I try to reconstruct the routing table like #5286 ,so i use

ipconfig result:
Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::19b8:9766:bd3:f15d%90
   IPv4 Address. . . . . . . . . . . : 172.25.64.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

try:
ip address add 172.25.64.10/20 broadcast 172.25.81.255 dev eth0
ip route add default via 172.25.64.1

when i try the second code,it show

ip: RTNETLINK answers: Network unreachable

by the time ,ip addr show eth0 and ip route show

LAPTOP-3DBWQSA:~# ip addr show eth0
4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:15:5d:d8:2b:aa brd ff:ff:ff:ff:ff:ff
    inet 172.25.64.10/20 brd 172.25.81.255 scope global eth0
       valid_lft forever preferred_lft forever
LAPTOP-3DBWQSA:~# ip route
LAPTOP-3DBWQSA:~#

Finally, I tried to uninstall docker, wsl, hyper-v, and even the hyper-v virtual network card, reinstall it

but the results are still the same.

Diagnostic Logs

No response

@OneBlue
Copy link
Collaborator

OneBlue commented May 14, 2021

Thanks for reporting this @luis-arch .

Can you please follow the 'networking-issues' section and share the script output and wsl.etl ?

@luis-arch
Copy link
Author

the networking.bat output:
networking_output.txt
the wsl.etl

wsl.etl is compressed into wsl.zip
wsl.zip

@OneBlue
Copy link
Collaborator

OneBlue commented May 18, 2021

Looking at the logs, this is known issue that should be fixed in insider builds that would trigger if the swap vhd is either compressed or encrypted.

This should be fixed by either of

  • Setting wsl2.swap=0 in .wslconfig
  • Moving the swap vhd to a non-encrypted and non-compressed folder

@luis-arch
Copy link
Author

thanks,It solve my problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants