Skip to content

Instantly share code, notes, and snippets.

@spoelstraethan
Created October 26, 2023 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spoelstraethan/b1f0cb745b4d418269ad86d749a11fa3 to your computer and use it in GitHub Desktop.
Save spoelstraethan/b1f0cb745b4d418269ad86d749a11fa3 to your computer and use it in GitHub Desktop.
WSL WSL2 subnet size/address adjustments

In an elevated Powershell

Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Name "NatNetwork"

This prints the current network in CIDR, the /20 is WAY too many hosts for what almost anybody might need.

Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Name "NatNetwork" -Value "172.17.128.0/24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment