enable WSL to HyperV networking

main
YIk Teng Hie 5 years ago
parent 8ab7c439e3
commit 344e6b3d72

@ -0,0 +1,25 @@
# 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
```
Loading…
Cancel
Save