WSL - vSwitch - Internal/Private - Static WSL IP/Subnet
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.**
VPN Ranges clash with randomly assigned WSL IPs, Connectivity to WSL is complicated and difficult at times, Random address make it difficult to send traffic to WSL. Docker ranges will clash occasionally.
**Describe the solution you'd like**
We would like the ability to use WSL attached to a HyperV swich where we control the subnet and the assigned IP address for vSwitch, and therefor can use init or systemd-network to assign a static ip to the WSL instance.
**Describe alternatives you've considered**
I have tried the following using a bridged adaptor, and although it works on an external switch, it does not work on an internal switch:
https://github.com/microsoft/WSL/issues/4150#issuecomment-1288152162
https://github.com/luxzg/WSL2-fixes
The following config:
[wsl2]
networkingMode=bridged
vmSwitch=WSL_external
Doesn't seem to work despite being so close to what we want. eth0 on WSL never comes up on the WSL interface.
Could we have:
[wsl2]
networkingMode=internal
vmSwitch=WSL_internal
or
[wsl2]
networkingMode=private
vmSwitch=WSL_private
Thanks,
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 reported networkingMode=bridged configuration with vmSwitch=WSL_external and review the two linked workaround references. Investigate how the requested internal or private switch behavior would provide a controlled subnet and static WSL address, including the case where eth0 never comes up. Done means WSL supports the requested configuration and connectivity is reliable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- 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