Code Monkey home page Code Monkey logo

Comments (3)

 avatar commented on September 25, 2024

I'm pretty sure is intentional. I'm pretty sure we haven't documented this, because we don't want people to rely on it. We've had a lot of discussion about this internally. Would you rather have wsl not launch?

from wsl.

ReneZeidler avatar ReneZeidler commented on September 25, 2024
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Lxss /t REG_SZ /v NatGatewayIpAddress /d 192.168.235.1 /f
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Lxss /t REG_SZ /v NatNetwork /d 192.168.235.0/20 /f

192.168.235.0/20 is not correct CIDR notation for a subnet. You set the number of mask bits to 20, but then set bits after the prefix to non-zero values.
What you probably meant is 192.168.235.0/24, which is the subnet containing the IP addresses 192.168.235.0 - 192.168.235.255.
(If you wanted to create a subnet of size /20 that includes 192.168.235.1, it would be 192.168.224.0/20, which contains the IP addresses 192.168.224.0 - 192.168.239.255. You can use a calculator like this to check your CIDR notation.)

This might be the reason why WSL failed to create the virtual network.

from wsl.

sarunoatama avatar sarunoatama commented on September 25, 2024

@ReneZeidler Thank you so much! I can't believe I overlooked such a simple mistake for so long.

This feature works beautifully with WSL 2 in NAT mode (the default) to make sure the subnet being used doesn't conflict with something else in the environments you connect to. On or off VPN (Cisco AnyConnect / Secure Client here) it routes the packets and DNS as you'd expect. Thank you for making this feature available WSL team!

If this stays open, I guess the feature request would be to have it warn if an invalid NAT/gateway combo are configured.

from wsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.