No network access from WSL/Ubuntu

sd flag

Microsoft Windows [Version 10.0.19043.1081] Ubuntu 20.04.2 LTS

I worked through the instructions for installing wsl for windows 10, from:

However, I cannot connect to the internet from Ubuntu. I switched off the firewall as suggested here:

But still could not connect.

There are a few things I have tried already but they did not resolve the problem (see below). As in the FAQ page:


From Ubuntu terminal I tried to install: curl | bash (6) Could not resolve host:

so I tried: ping ping: connect: Network is unreachable

I already posted a request for that but the problem is network access: []4

Some of the troubleshooting steps I have tried (which did not work)

  1. Disabled the firewall.
  2. Re-installed ubuntu.
  3. BT (my internet provider), port forwarding:
  4. Checked Network Connection settings
    Ethernet Properties
    vEthernet Properties (WSL)
    Hyper-V Virtual Ethernet Adapter
    Internet Protocol Version 4 (TCP/IPv4) -checked
    Internet Protocol Version 6 (TCP/IPv6) -checked
    Hyper-V Extensible Virtual Switch -unchecked
  5. Checked Device Manager (View Hidden) Network adapters > Hyper-V Virtual Ethernet Adapter Properties
    Device status - This device is working properly.
  6. Turn Windows features on and off
    Uncheck Windows Subsystem for Linux
    Windows needs to reboot your PC to finish the requested changes
    Recheck Windows Subsystem for Linux
    Windows needs to reboot
  7. Change the nameserver sudo nano /etc/resolv.conf
    '# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/resolv.conf
    '# [network]
    '# generateResolvConf = false
    nameserver xxx.xx.xx
    Change the name server to and save the file. You should now be able to connect to the internet.
    -even restarted ubuntu, same error after restarting and the nameserver seems to be reset to default
  8. Flush DNS Open Powershell or Cmd as Administrator
    and run each of these commands:
    wsl --shutdown
    netsh winsock reset
    netsh int ip reset all
    netsh winhttp reset proxy
    ipconfig /flushdns
    Hit the Windows Key,
    type Network Reset,
    hit enter.
    You should see this window.
    Click "Reset now".
    Restart Windows
mrexodia avatar
pf flag
You could try
nanangarsyad avatar
id flag
@mrexodia I was having the same issue with OP, not sure of the cause, but your solution using wsl-vpnkit solve my problem. It'd be great if you could move your comment into an answer instead. It might be useful to the others.
mrexodia avatar
pf flag
Not sure how to convert a comment to an answer, but I wrote something.
pf flag

This issue started occurring for me after installing a corporate Cisco VPN package. I narrowed it down to incorrect weights on the virtual network adapter. The solution for me was to install, which resolved everything without additional configuration.


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.