You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
846 B
Markdown

# WSL VM Networking
* Powershell (run as administrator)
* [Steps](https://automatingops.com/allowing-windows-subsystem-for-linux-to-communicate-with-hyper-v-vms) to enable networking between WSL & HyperV
```powershell
// show switches
$ Get-VMSwitch
// show networking interfaces
$ Get-NetIPInterface
// enable forwarding of wsl
$ Get-NetIPInterface | `
where {$_.InterfaceAlias -eq 'vEthernet (WSL)'} | `
Set-NetIPInterface -Forwarding Enabled -Verbose
// verify forwarding enabled
$ Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)'} | Select-Object ifIndex,InterfaceAlias,ConnectionState,Forwarding
// enble on both WSL & Default switch
$ Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (Default Switch)'} | Set-NetIPInterface -Forwarding Enabled -Verbose
```