Ensure that WSL2 uses the Windows IP (including VPN connection)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
Is your feature request related to a problem? Please describe.
When I use WSL2 whilst connected on VPN, I always have to issue a command Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 4000 in PowerShell in order to unlock internet connection in WSL2, provided that the configuration as described in this link has been satisfied. Otherwise I can't connect to the Internet using e.g. ping www.google.com since the WSL2 IP differs from Windows'.
Describe the solution you'd like
WSL2 shouldn't generate dynamic IP addresses per reboot but use the one on the Windows OS level alongside VPN connection if available. Using UNIX shell shouldn't cost time just for configuring it on WSL2 for the sake of developer experience.
Describe alternatives you've considered
A ready to use terminal like Windows PowerShell based on your WSL2 image without the need to configure all that connectivity stuff.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the WSL2 VPN connectivity problem described in the issue, including the linked configuration and the PowerShell InterfaceMetric command. Done means WSL2 uses the Windows-side IP or VPN path across reboots and can reach the internet without manual PowerShell configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100