copperferro.blogg.se

Ping website network is unreachable linux ubuntu 18
Ping website network is unreachable linux ubuntu 18









  1. #Ping website network is unreachable linux ubuntu 18 update#
  2. #Ping website network is unreachable linux ubuntu 18 upgrade#
  3. #Ping website network is unreachable linux ubuntu 18 Pc#

Hope this saves someone a lot of hassle on a company administered PC.

#Ping website network is unreachable linux ubuntu 18 Pc#

I know this is not pretty, and pulls from many different solutions posted all over the internet, but it's the only one that works with my corporate administered PC and group policies. Note if your distribution isn't under \wsl$\debian\ you'll need to change it to where it actually resides. # Convert the DOS formatted file into UNIX format for WSL2 and write it in the proper place (\etc\nf, its primary location is \\wsl$\ from Windows) Sc -Path 'c:\Users\Public\Documents\nf' -Value ('nameserver ' + $nameserver) -Encoding utf8 # Run Set-Contents (sc) to write the nf file in a public location as it has DOS formatted line endings written by PowerShell, not readable by Linux $nameserver = Out-String -InputObject $nameserver # Convert nameserver object into a string Get-NetAdapter | Where-Object | select -ExpandProperty DNSServerSearchOrder

  • Change Cisco Anyconnect metric from default 1 to 6000 inside powershell.
  • Search # The search domain that we got from step 2 # The company DNS/nameserver from the command in step 1 # This config will prevent wsl2 from overwritting the nf file everytime Sudo unlink /etc/nf # this will unlink the default wsl2 nf Get-DnsClientGlobalSetting | Select-Object -ExpandProperty SuffixSearchList
  • Get search domain (execute in PowerShell).
  • Get-DnsClientServerAddress -AddressFamily IPv4 | Select-Object -ExpandProperty ServerAddresses
  • Connect VPN and get DNS servers list, we will need it later (execute in elevated PowerShell).
  • Took me hours trying to troubleshoot this, hope this is useful to someone someday. Didn't work.įinally found this posted solution, and WSL 2 suddenly works perfectly. Spent an hour configuring my WSL's /etc/nf and /etc/wsl.conf and troubleshooting the auto-config bug ( ).

    #Ping website network is unreachable linux ubuntu 18 update#

    Hadn't used WSL 2 in months, was trying to sudo apt update from a Debian distro's terminal when I discovered my internet wasn't working. Troubleshooting steps before finding the above recipe:

    #Ping website network is unreachable linux ubuntu 18 upgrade#

    However curl -location -iĪnd sudo apt-get update & sudo apt-get upgrade now works. If you're lucky, WSL 2 should now be able to sudo apt-get update & sudo apt-get upgrade.įor me I am still unable to ping sites, but internet seems to work everywhere else in WSL 2.įor instance, ping (or pinging any site) And run each of these commands: wsl -shutdown











    Ping website network is unreachable linux ubuntu 18