Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL Cannot undertand linux host with mirrored mode and custom domain name #10813

Closed
1 of 2 tasks
Dokman opened this issue Nov 22, 2023 · 27 comments
Closed
1 of 2 tasks

WSL Cannot undertand linux host with mirrored mode and custom domain name #10813

Dokman opened this issue Nov 22, 2023 · 27 comments
Labels

Comments

@Dokman
Copy link

Dokman commented Nov 22, 2023

Windows Version

Microsoft Windows [Versión 10.0.22631.2715]

WSL Version

2.0.11.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-1

Distro Version

Ubuntu 20.04

Other Software

Docker Desktop: 4.25.2

Repro Steps

Use mirrored in networking, set hosts file in windows to point your lAN ip 192.168.1.x hostname.name

Expected Behavior

Enter into the website

Actual Behavior

Refuses to connect but outside network is working

Diagnostic Logs

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

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. Thank you!

Open similar issues:

Closed similar issues:

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

@Dokman
Copy link
Author

Dokman commented Nov 22, 2023

After a new fresh install with Ubuntu 22.0.4 it's the same, connection refused

@Dokman Dokman changed the title WSL Cannot use mirrored with a domain name WSL Cannot undertand linux hosts with mirrored mode and custom domain name Nov 24, 2023
@Dokman Dokman changed the title WSL Cannot undertand linux hosts with mirrored mode and custom domain name WSL Cannot undertand linux host with mirrored mode and custom domain name Nov 24, 2023
@chanpreetdhanjal
Copy link

Could you please follow the steps below and attach the diagnostic logs? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@CatalinFetoiu
Copy link
Collaborator

@Dokman, can you please try setting dnsTunneling=true, restart WSL and retry your scenario?

In mirrored mode, in order for Windows DNS policies (such as the Windows hosts file) to be applied to WSL DNS traffic, dnsTunneling must be enabled

thanks

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

it doesn't work too. sorry for being inactive too long, i was having troubles i tried with dnsTunneling=true but it doesn't work too

@CatalinFetoiu
Copy link
Collaborator

@Dokman thanks for following up. Can you please collect networking logs using instructions below? The script will create a zip with name starting with "WslNetworkingLogs"

https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

please also share the name you are trying to resolve and is not working, so we can look for that in the traces

thanks

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

i'm trying to access to my nginx that i've made but it doesn't work i'll upload the zip

WslLogs-2024-04-03_19-34-49.zip

Copy link

github-actions bot commented Apr 3, 2024

The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
.wslconfig found
Detected appx version: 2.2.1.0
Found no WSL traces in the logs

@CatalinFetoiu
Copy link
Collaborator

CatalinFetoiu commented Apr 3, 2024

@Dokman please use the networking script (https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1).

It looks like you used the regular https://github.com/microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1

can you please also share the name you are trying to resolve? from your description, I see "hostname.name"

thanks

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

@Dokman please use the networking script (https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1).

It looks like you used the regular https://github.com/microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1

can you please also share the name you are trying to resolve? from your description, I see "hostname.name"

thanks

I was trying to resolve localhost and 192.168.1.130 if I can't connect to the IP I cannot connect to the nginx hahahah

WSLConfig

[wsl2]
memory=16GB
networkingMode=mirrored
dnsTunneling=true
autoProxy=true
firewall=true
debugConsole=true
dnsProxy=true

[experimental]
useWindowsDnsCache=true
hostAddressLoopback=true

@CatalinFetoiu
Copy link
Collaborator

thanks. a few follow up questions to better understand your scenario

how are you configuring the 192.168.1.130 IP? is it an IP assigned to Windows?
are you connecting to 192.168.1.130 from inside WSL or from Windows?
how are you using nginx?
are you adding configurations to the Windows hosts file? from your description it sounds like that's the case

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

thanks. a few follow up questions to better understand your scenario

how are you configuring the 192.168.1.130 IP? is it an IP assigned to Windows? are you connecting to 192.168.1.130 from inside WSL or from Windows? how are you using nginx? are you adding configurations to the Windows hosts file? from your description it sounds like that's the case

Yes that's my windows IP, so if i want to test it on my end localhost doesn't work too. The network is mirrored, yes, but doesn't loopback or get any feedback from the server.

i'm not adding any windows hosts editing there's my log
WslNetworkingLogs-2024-04-03_21-04-30.zip

PSA: I've disabled the firewall because it's having error too with firewall disabled too

Copy link

github-actions bot commented Apr 3, 2024

Diagnostic information
.wslconfig found
Detected appx version: 2.2.1.0

@CatalinFetoiu
Copy link
Collaborator

are you connecting from Windows to a Linux server listening on 192.168.1.130? or the opposite way (connecting from Linux to a Windows server listening on 192.168.1.130)? what is the port you are connecting to?

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

@Dokman

Add a comment

Comment
Write
Preview

Add your comment here...

Markdown is supported
Paste, drop, or click to add files
Close issue
Comment
Remember, contributions to this repository should follow its contributing guidelines, security policy, and code of conduct.
Assignees
No one assigned
Labels
network
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests

Notifications
Customize

Unsubscribe
You’re receiving notifications because you were mentioned.

4 participants
@Dokman

i'm trying to connect my windows to the linux wsl machine, it's the same machine they are the same ip because it's the same machine

@CatalinFetoiu
Copy link
Collaborator

thanks. from the Linux tcpdump output in the logs you shared, I see SYN packets sent to 192.168.1.130, port 80 reaching Linux, but I don't see a reply from the server listening on 192.168.1.130, port 80

do you have logs from your nginx server (I assume nginx is the server listening on 192.168.1.130, port 80), where you can check if nginx received the connection request?

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

idk, i can install an apache if needed

PSA: Log with apache2

@Dokman
Copy link
Author

Dokman commented Apr 3, 2024

WslNetworkingLogs-2024-04-03_23-14-02.zip

Copy link

github-actions bot commented Apr 3, 2024

Diagnostic information
.wslconfig found
Detected appx version: 2.2.1.0

@Dokman
Copy link
Author

Dokman commented Apr 4, 2024

After adding the firewall Rules works outside my PC but in localhost mode it doesn't work so i can't work in my pc vieweing anything

@CatalinFetoiu
Copy link
Collaborator

thanks for your quick responses and patience for this issue

from the latest logs you shared, I see the same case of SYN packets being sent to 192.168.1.130, port 80 reaching Linux, then there is no reply from the server listening on 192.168.1.130, port 80

can you please share the steps you use to install and start the nginx or apache2 server? I can try to reproduce this on my setup.

@Dokman
Copy link
Author

Dokman commented Apr 11, 2024

I'm using a default config, so i cannot understand how it doesn't connect
default.zip

Copy link

Failed to parse logs. Unexpected file: default.conf
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
Found no WSL traces in the logs

@CatalinFetoiu
Copy link
Collaborator

CatalinFetoiu commented Apr 11, 2024

thanks. I tried installing nginx (looking at the /etc/nginx/ folder, nginx has the same default config as you shared) - unfortunately I was not able to repro the issue

one additional question: are you running nginx inside a container, such as Docker?

a few things to try:

  1. we have seen compat issues with localhost communication between Windows and Linux not working when the Linux "network manager" service is running (similar issue - Networking mirrored can't work on WSL2 #10632)

Can you run "systemctl status network-manager.service" and if it shows the service as running, try disabling it using "systemctl disable network-manager.service", then retry your scenario.

  1. we have seen issues when a Linux application will listen on IPv6, but localhost communication between Windows and Linux is not supported for IPv6, it's only supported for IPv4 at the moment.

Can you run "netstat -tlnp" and verify the output is similar to the one below, showing a listener on port 80 on IPv4 and one listener on IPv6

netstat -tlnp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.255.255.254:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -

@Dokman
Copy link
Author

Dokman commented Apr 12, 2024

So you will tell me, i'm not using docker to listen to any port right now

image

image

On an External end works
image

@Dokman
Copy link
Author

Dokman commented Apr 12, 2024

image
image

so i cannot curl it

@Dokman
Copy link
Author

Dokman commented Apr 16, 2024

My windows was borken after a Windows 11 reinstall worked well

@Dokman Dokman closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants