microsoft / WSL

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

WSL2 not connecting to internet without VPN (with VPN, it connects) #11502

Open mys2kor opened 6 months ago

mys2kor commented 6 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3447]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.146.1-microsoft-standard-WSL2 (root@65c757a075e2) (gcc (GCC) 11.2.0

Distro Version

Ubuntu-22.04

Other Software

No response

Repro Steps

Connect to the corporate in the office (which does NOT requires the usage of VPN) and WSL2 does not have internet.

The .wslconfig located at "C:\Users\myusername.wslconfig" is as below

# Settings apply across all Linux distros running on WSL 2
[wsl2]

# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=4GB

# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap=2GB

# If the value is mirrored then this turns on mirrored networking mode.
networkingMode=mirrored

# Enforces WSL to use Windows’ HTTP proxy information
autoProxy=true

# Setting this to true allows the Windows Firewall rules, as well as rules specific to Hyper-V traffic, to filter WSL network traffic.
firewall=false

[experimental]
autoMemoryReclaim=dropcache

I have environment variables set as follows for proxies (just representative URLs, not actual)

http_proxy
http://rb-proxy-rst.brd.com:8080

https_proxy
http://rb-proxy-rst.brd.com:8080

The wsl,conf file in WSL at /etc/wsl.conf is as below `` [user] default=myusername

[interop] enabled=true appendWindowsPath=true

[network] generateResolvConf = false

[boot] systemd=true

The `resolv,conf` file in WSL at `/etc/resolv.conf` is as below

nameserver 10.187.250.203 nameserver 10.171.121.11



### Expected Behavior

WSL2 should connect to the internet even in office but it does not when testing the connection with curl, I get the error "curl: (22) The requested URL returned error: 407"

### Actual Behavior

WSL2 connects to the internet when working behind a proxy (using Cisco AnyConnect) without any changes to the above mentioned settings.

### Diagnostic Logs

My computer prevents me from opening Feedback Hub & due to lack of rights I am unable to install WPR as well.
github-actions[bot] commented 6 months ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mys2kor commented 6 months ago

I tried to collect logs as mentioned here https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method and below is the result when I try to execute collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) image

Then I tried to collect the log using WPR & below is the message when I try to run Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-networking-logs.ps1" -OutFile collect-networking-logs.ps1 image image

chanpreetdhanjal commented 6 months ago

Hi. Can you please collect networking logs by following the instructions below? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

mys2kor commented 6 months ago

Hi. Can you please collect networking logs by following the instructions below? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

I have tried all of these methods and provided the outputs that I am getting. Unfortunately all the methods are running into errors

chanpreetdhanjal commented 6 months ago

Can you please share the error report while running Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-networking-logs.ps1" -OutFile collect-networking-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-networking-logs.ps1