WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 , problem with network connection when VPN used (PulseSecure)

Open fibu79 opened this issue 6 years ago • 384 comments

I'm using MS v. 2004 (build 19041) with UBUNTU linux on WSL2. When I don't use VPN on windows , everything is fine - I have internet connection on windows and wsl2 ubuntu. But when established connection via VPN (on windows) then on windows still is OK - I have both internet and vpn connection , but on Ubuntu there is no network connection at all (no internet , no vpn access). I suspect there is a problem with NAT (on Hyper-V default switch) Any idea what could be wrong ? Additionally: on wsl1 everything worked fine (also when VPN enabled)

Currently on wsl2 it looks like this : fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.30.123.209 netmask 255.255.240.0 broadcast 172.30.127.255 inet6 fe80::215:5dff:fe41:b550 prefixlen 64 scopeid 0x20 ether 00:15:5d:41:b5:50 txqueuelen 1000 (Ethernet) RX packets 263 bytes 27705 (27.7 KB) RX errors 0 dropped 1 overruns 0 frame 0 TX packets 223 bytes 34352 (34.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 2 bytes 56 (56.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 56 (56.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ ping google.com ping: google.com: Temporary failure in name resolution fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 172.30.112.1 0.0.0.0 UG 0 0 0 eth0 172.30.112.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0 fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$ cat /etc/resolv.conf nameserver 172.30.112.1 fibu@DESKTOP-3N4US3P:/mnt/c/Users/fibu2$

fibu79 avatar Apr 10 '20 08:04 fibu79

Does anyone can help ...?

fibu79 avatar Apr 18 '20 15:04 fibu79

I'm troubling with the samilar problem here. It's frustrating

haiyangwang-1 avatar Apr 29 '20 05:04 haiyangwang-1

same problem, wsl1 working fine, all the distros in wsl2 is not connecting to internet

aaemon avatar May 01 '20 16:05 aaemon

I am having a similar issue when I'm on the GlobalProtect VPN connection to our corporate network. One workaround I've found is to add the IP for your router to /etc/resolv.conf as a nameserver entry.

akulbe avatar May 04 '20 16:05 akulbe

Same here, seems to be intermittent though. Also have docker desktop running and stopping that has fixed it a couple of times but not always.

dys152 avatar May 04 '20 17:05 dys152

i have the same problem

yanke1311 avatar May 18 '20 06:05 yanke1311

Same problem here. WSL2 can't access internet after connecting to VPN. If I turn it off, things are OK again. Using windows VPN configuration (IKEv2), no special VPN app.

carl-berg avatar May 25 '20 07:05 carl-berg

Latest pulse secure vpn client for corp vpn connection and experiencing the same issue. WSL2 has almost none existent internet connection when connected on VPN

peterhorvath avatar May 28 '20 09:05 peterhorvath

Same issue happens on released Windows 10 2004, run Ubuntu 20.04 on WSL2 when connect to Pulse Secure.

I have tried solutions mentioned in https://github.com/microsoft/WSL/issues/1350
Didn’t work to me.

honeway avatar May 28 '20 09:05 honeway

https://github.com/microsoft/WSL/issues/4277

peterhorvath avatar May 28 '20 11:05 peterhorvath

same problem for me, cisco anyconnect vpn client running Windows 10 2004 WSL2 Ubuntu 18.04 and 20.04

petersonsbuild avatar May 29 '20 06:05 petersonsbuild

Interestingly i can curl http sites while on vpn but not https.

peterhorvath avatar May 29 '20 07:05 peterhorvath

okay it is resolve for me, apparently IT had a transparent url filtering proxy when i am connected to VPN and needed bypass, it also works when i set http_proxy/https_proxy and proxy for apt within WSL2 to the corp proxy.

peterhorvath avatar May 29 '20 10:05 peterhorvath

@peterhorvath is your anyconnect setup to use full tunnel?

chazt3n avatar Jun 02 '20 15:06 chazt3n

it is pulse secure vpn but yes it is full tunnel.

peterhorvath avatar Jun 02 '20 18:06 peterhorvath

I'm having same issues, have read multiple reports on here and elsewhere. Everything worked against Cisco AnyConnect when using WSL v1. After upgrading to latest Windows and updating to WSL v2, my internet connectivity inside WSL is broken. I'm in split-tunnel mode, but will try full-tunnel.

luvwagn avatar Jun 03 '20 00:06 luvwagn

When WSL2 is started after connecting to VPN through Pulse Secure, WSL2 can access the Internet, but not https.

honeway avatar Jun 03 '20 01:06 honeway

if you have corporate proxy try to set http_proxy in WSL2 I had to do

export http_proxy=whatever.com:9091
export https_proxy=whatever.com:9091
export no_proxy=*.internal.domain.com,10.0.0.0/8 

talk to your IT team, (out comapny using mcafee web gateway and client proxy)

peterhorvath avatar Jun 03 '20 07:06 peterhorvath

I have same problem..frustrated

DadongZ avatar Jun 03 '20 15:06 DadongZ

Same problem here, with CiscoAnyconnect...

crisrise avatar Jun 03 '20 15:06 crisrise