microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.43k stars 821 forks source link

WSL 2 Ubuntu 22.04.2 LTS Lost internet access when VPNing with Citrix Secure Access #10104

Open sugita01 opened 1 year ago

sugita01 commented 1 year ago

I have WSL 2 (Ubuntu 22.04.2 LTS) running on Win10 Enterprise ver 22H2. When I start the Ubuntu 20.04 instance my WSL instance still have internet connectivity. However, once I connect to my work VPN using Citrix Secure Access, i lost internet connectivity inside my Ubuntu WSL instance. When I try ping www.afr.com.au, it results in: ping :www.afr.com.au: Temporary failure in name resolution

I do get an IP address of 172.31.176.8. My cat /etc/resolv.conf is as below:

nameserver 8.8.8.8
nameserver 192.168.152.221
nameserver 192.168.152.231
nameserver 172.19.96.1
search companya.com.au.local

My vEthernet(WSL) is 172.31.176.1 when i tried to traceroute www.yahoo.com, it returns: www.yahoo.com: Temporary failure in name resolution. Cannot handle 'host' cmdline arg 'www.yahoo.com' on position 1 (argc 1)

My /etc/wsl.conf is:

[network]
generateResolvConf = false

In my windows 10 cmd, when i try to run nslookup (whilst connected to vpn) it returns: image

I also tried to turn off firewall in Windows Defender firewall settings, only for vEthernet WSL: image

Below is the result of Get-NetIPInterface: image

zyition commented 1 year ago

You can try https://github.com/sakai135/wsl-vpnkit, it's a perfetc solution for me

sugita01 commented 1 year ago

I already tried that sakai135 script. Unfortunately, I still encountering the same error and my WSL box still unable to ping google. My WSL box cant even ping the ip address of the windows host IP address. When trying to ping the Windows Host ip address, it just freeze and did not return anything. i have press Ctrl+C to break and exit it.

zyition commented 1 year ago

did you try 2.x? Both version 3.x and 4.x don't work for me, but 2.x works well 🤣

sugita01 commented 1 year ago

no i didnt try version 2.x. how do i get and try specific version?

zyition commented 1 year ago

You can download specific versions by tag, for example: https://github.com/sakai135/wsl-vpnkit/releases/tag/v0.2.5. And read the documentation here https://github.com/sakai135/wsl-vpnkit/tree/v0.2.x

sugita01 commented 1 year ago

yup - tried version 0.2.5 and still same issue as well.

dylangovender commented 1 year ago

@sugita01 are you sure you installed V0.2.5 correctly?

I was in a very similar situation to yours. WSL2 had no network connectivity when the host machine was connected to Citrix Secure Access.

I tried the latest versions of the script but it did not help. I was about to give up but tried out 0.2.5 and it seems to be working.

Thanks for the tip, @zyition!

terlar commented 5 months ago

I have connection working with the latest wsl-vpnkit 0.4.1. However trying to use anything else, e.g.

[wsl2]
networkingMode=mirrored
firewall=true
dnsTunneling=true
autoProxy=true

Doesn't work unless I also use wsl-vpnkit. Would be nice if it was possible to get to work without wsl-vpnkit. Any ideas what I could do to debug so we could once and for all figure out the root of the connectivity issue with Citrix Secure Access + WSL?

TheGP commented 2 months ago

@terlar where did you put those settings you wrote?

zyition commented 2 months ago

@terlar where did you put those settings you wrote?

you can refer to this doc https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig