Problem
When executing the following command line in Powershell while configuring Firewall rules for WSL:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow`
Some users may encounter this issue:
New-NetFirewallRule : The specified interface was not found on the system.
Cause
Most likely, the network interface name was changed from the default vEthernet (WSL) to something else, causing the command to fail.
Resolution
-
Execute the below command in Powershell to get the list of all network interfaces in the system:
Get-NetAdapter -IncludeHidden -
Find the actual name of the interface used by WSL (it will be one of the Hyper-V Virtual Ethernet Adapters)
Note: if no device is displayed at all, you might need to reset your WSL configuration by clearing or removing the %UserProfile%.wslconfig file, performing
wsl --shutdown, and then retrying theGet-NetAdaptercommand in PowerShell. -
Replace
vEthernet (WSL)in theNew-NetFirewallRule...command with the actual interface name and execute it again:
Comments
0 comments
Please sign in to leave a comment.