Skip to content

Ensure that WSL2 uses the Windows IP (including VPN connection) #7159

@cloutstrife13

Description

@cloutstrife13

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions