Friday, October 21, 2022

No internet Connection from WSL2

I was facing an issue while connecting to the internet from WSL2 on a Windows 10 machine; the ping and telnet were both not working.

Followed the below steps to resolve the problem

Execute the ipconfig command in PowerShell

Execute the below command on WSL2

sudo ifconfig eth0 netmask

sudo route add default gw - default gw address - Select an IP address within the same range - netmask

Execute the below command on PowerShell

wsl --shutdown

Now open the WSL terminal. You should be able to connect to the internet.

No comments:

Post a Comment