-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL - vSwitch - Internal/Private - Static WSL IP/Subnet #9251
Comments
Indeed, I tried both Private and Internal vSwitch and they seem to act as if interface is simply disconnected. While External vSwitch works. I don't see why there should be any differentiation between vSwitch types from the WSL side. If you try it with any other VM these switches work exactly the same, it's just "yet another" Ethernet adapter for the OS. |
Without a static IP for the WSL instance, it is very inconvenient to use
|
The default range used clashes with the company network at 172.16.0.0/12 |
Newer WSL has some registry keys to configure the static IP address. Please see this discussion #9580 |
I think what we discussed in that thread is that the new WSL uses a
registry key which happens to set the IP to a static value.
But it is unclear that if that feature or that behaviour will stay the same.
…On Tue, 11 Apr 2023, 14:24 Biswapriyo Nath, ***@***.***> wrote:
Newer WSL has some registry keys to configure the static IP address.
Please see this discussion #9580
<#9580>
—
Reply to this email directly, view it on GitHub
<#9251 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQBTIGDVOVL6MP5AWDAKDXATMHBANCNFSM6AAAAAASRWEB64>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It seems that the fixed IP cannot be directly modified by modifying the registry, and the ip segment will be reset every time wsl starts |
Did you change all the three registry values - NatIpAddress, NatNetwork and NatGatewayIpAddress ? |
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:
#4150 (comment)
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,
The text was updated successfully, but these errors were encountered: