I had an Ubuntu under WSL 1 working fine and connecting to the internet.
Just by upgrading to wsl2, I can't ping google.com from Bash. But I can ping if I downgrade to wsl1.
Here is the issue:[WSL2] No network · Issue #4731 · microsoft/WSL
I tried this but it's not working.
Step 1: open Hyper-V manager as admin
Step 2: select Virtual Switch Manager From Actions
Step 3: select WSL
Step 4: select External Network; choose an adapter and connect to the internet
My windows ipconfig
Ethernet adapter vEthernet (WSL):
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::30a4:2612:6ee3:2390%142
IPv4 Address. . . . . . . . . . . : 192.168.0.103
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
ping 192.168.0.103
from Ubuntu:
xxxxxxxxx@xxxxxxxxxxx:~$ ping 192.168.0.103
PING 192.168.0.103 (192.168.0.103) 56(84) bytes of data.
From 172.22.131.55 icmp_seq=1 Destination Host Unreachable
From 172.22.131.55 icmp_seq=2 Destination Host Unreachable
ip route
from Ubuntu:
xxxxxxxxx@xxxxxxxxxxx:~$ ip route
default via 172.22.128.1 dev eth0
172.22.128.0/20 dev eth0 proto kernel scope link src 172.22.131.55
From Ubuntu, tried sudo ip route add default via 192.168.0.103
:
xxxxxxxxx@xxxxxxxxxx:~$ sudo ip route add default via 192.168.0.103
RTNETLINK answers: Network is unreachable