Skip to content

Instantly share code, notes, and snippets.

@jakawell
Last active July 7, 2020 16:23
Show Gist options
  • Save jakawell/a6ff7e411e4fc384cd7137ac657abb32 to your computer and use it in GitHub Desktop.
Save jakawell/a6ff7e411e4fc384cd7137ac657abb32 to your computer and use it in GitHub Desktop.
How to setup WSL2 to function with VPNs running on the host
  1. Update to Windows 10, version 2004
  2. Install the Windows Linux kernal and a Linux distro (these steps are tested with Ubuntu 20.04)
  3. Log in to your WSL distro and create the /etc/wsl.conf file with the following values:
[network]
generateHosts = false
generateResolvConf = false

[interop]
appendWindowsPath = false
  1. Create or replace the /etc/resolv.conf file with the following (or with your favorite public DNS nameservers, just not your Windows host):
nameserver 8.8.8.8
nameserver 8.8.4.4
  1. Open an Administrator instance of Powershell on your Windows host and run wsl --shutdown
  2. Log back in to your WSL distro and verify network connectivity via ping google.com
  3. Install and configure Openconnect UI on your Windows host
  4. Connect to your VPN with Openconnect
  5. Verify that your WSL distro still has network connectivity via ping google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment