deanmcniven / wsl2-vpn-support

This Powershell script will reconfigure the system routes to fix WSL2 networking when on a VPN
45 stars 23 forks source link

win11: name of PANGP Virtual Adapter does not match "vEthernet (WSL)" #10

Open reschke opened 3 months ago

reschke commented 3 months ago

This may be an understanding issue on my side though. The actual name is just "Ethernet 5".

(So I guess the question is: did something in WSL or Win11 change to that the name isn't set anymore?)

codemarwin commented 3 months ago

Seems like, so.. I can see the same on my side. Running Win11 WSL2(Ubuntu24.04) right now. Below works for me.

########### Configuration Parameters

$vpn_interface_desc = "PANGP Virtual Ethernet Adapter"
$wsl_interface_name = "Ethernet 5"
$wsl_interface_id   = "eth0"

$config_default_wsl_guest = 1 # 0: False, 1: True
$wsl_guest_list = @("Ubuntu-24.04")

$state_file = "$HOME\WSL2\vpn_state\wsl2_vpn_state.txt"

########### End Configuration Parameters

But I was using previously

$wsl_interface_name = "vEthernet (WSL)"

Probably some change that came with Win11 update.

:edit: Please check below comment, suggestion in this one is not working fully.

codemarwin commented 2 months ago

I resolved this by just adding both interface names as a list. You can check my fork here: https://github.com/codemarwin/wsl2-vpn-support/blob/master/configure-wsl-networking.ps1

Above works for me fine. For my first comment I had some issues and I do recommend adding a list of interface names to check.