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

Only one lo network card with networkingMode=mirrored #10650

Closed
1 of 2 tasks
FlowerBirds opened this issue Oct 20, 2023 · 20 comments
Closed
1 of 2 tasks

Only one lo network card with networkingMode=mirrored #10650

FlowerBirds opened this issue Oct 20, 2023 · 20 comments
Labels

Comments

@FlowerBirds
Copy link

Windows Version

10.0.22635.2486

WSL Version

2.0.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.123.1-1

Distro Version

Ubuntu 18.04

Other Software

No response

Repro Steps

use ifconfig command

Expected Behavior

should show eth0 netwrok card indo

Actual Behavior

(base) root@LAPTOP-TC4A0SCV:~# ifconfig
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 16 bytes 1336 (1.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 1336 (1.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

(base) root@LAPTOP-TC4A0SCV:~#

Diagnostic Logs

network not work!

@FlowerBirds
Copy link
Author

image

image

@FlowerBirds
Copy link
Author

FlowerBirds commented Oct 24, 2023

@Yolo-plop
Copy link

Having the same issue. I can't connect to my WSL nginx server from Windows and it seems like the wsl instance doesn't even have access to Internet.

@keith-horton
Copy link
Member

Hi there. I looked at the trace but there isn't much there. Can you stop wsl, start the trace, repro the issue, then stop the trace for us?
we have a better script now: https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1

Thanks!

@Ynewtime
Copy link

Same issue here only when configured with networkingMode=mirrored.

Want to have a trace though unfortunately it is a company laptop...

@FlowerBirds
Copy link
Author

The problem still occurs in the 2.0.9 version.

@FlowerBirds
Copy link
Author

The problem still occurs in the 2.0.11 version.

@FlowerBirds
Copy link
Author

networkingLogs.zip

  • Before start: WslNetworkingLogs-2023-11-23_09-06-25
  • Running: WslNetworkingLogs-2023-11-23_09-07-44
  • After running and shutdown: WslNetworkingLogs-2023-11-23_09-08-31

@keith-horton thanks.

@FlowerBirds
Copy link
Author

wsl debug info.txt

debugConsole=true

@CatalinFetoiu
Copy link
Collaborator

@FlowerBirds it seems there was an issue collecting the logs, as I don't see the expected files in the archive you shared.

Can you please do the following steps to get new logs?

  1. Close your WSL terminals and run "wsl --shutdown"
  2. Start the networking logs script - https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1
    (Please wait until the script displays it started log collection)
  3. Start WSL and confirm the issue is present
  4. Stop the networking logs script
  5. The script will generate a zip file with name starting with "WslNetworkingLogs" - please attach the zip file to the issue

Thanks

@FlowerBirds
Copy link
Author

@CatalinFetoiu
Copy link
Collaborator

@FlowerBirds thanks for sharing the traces

it appears that WSL was not fully stopped before taking the traces.
to get a trace of a fresh boot of WSL, can you please do the following?
net.exe stop WslService
net.exe stop LxssManager
start the script
start WSL and confirm the issue
stop the script

Also, after traces are stopped, can you please copy the output of the script in a file and attach it to the issue? I see some files were not collected in the zip and I want to check if there was any issue when running the script

thanks

@FlowerBirds
Copy link
Author

WslNetworkingLogs-2023-11-29_09-41-47.zip

capture-logs.txt

image

@ArslanTu
Copy link

ArslanTu commented Apr 5, 2024

I have solved this with the help of this issue.
Just open regedit and chang the value of DisabledComponents (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\) from 0xFF to something else, like Decimal 32. Then reboot and enjoy it.
Reference

@Ynewtime
Copy link

Ynewtime commented Apr 5, 2024

@ArslanTu You are unbelievable! This just solve my long lasting problem!!! Thank you!

@keith-horton
Copy link
Member

Right. setting this to 0xFF will risk apps and services to not behave correctly - it's an old registry value from before the tcpip stack rewrite in Windows Vista.

As in the linked PR, you can directly removing the v6 binding if you want to disable IPv6 - which is supported:

Set-NetAdapterBinding -Name Wi-Fi -ComponentID ms_tcpip6 -Enabled $false

(replace "Wi-Fi" with the adapter name you have)

@keith-horton
Copy link
Member

@FlowerBirds , can you see if the Tcpip6\Parameters DisabledComponents registry value is set on your machine?

@FlowerBirds
Copy link
Author

@keith-horton Change the default value of DisabledComponents from 255 to 32, after restarting the computer, open WSL, and there will be four additional network card information, from eth0 to eth3.

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:ff:b6:0b:78:c6 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether f4:a4:75:10:4a:b9 brd ff:ff:ff:ff:ff:ff
4: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:17:96:5a brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 7c:8a:e1:c3:e8:64 brd ff:ff:ff:ff:ff:ff
    inet 191.168.4.38/21 brd 191.168.7.255 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
6: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:ff:3b:8b:62:2c brd ff:ff:ff:ff:ff:ff

When I check the default value of DisabledComponents again, it changes back to 255.

Finally, I tested the connectivity using localhost and the IP address, and found that localhost is accessible, but using the IP address does not work.

.wslconfig

[wsl2]
processors=6
memory=8G
swap=8G
localhostForwarding=true
dhcp=false
kernelCommandLine = vsyscall=emulate ipv6.disable=1
nestedVirtualization=false
debugConsole=false
autoProxy=false
networkingMode=mirrored

@keith-horton
Copy link
Member

@FlowerBirds , thanks. using the local IP address requires setting [experimental] hostAddressLoopback = true

We have this false by default to work around other Linux container issues.

@CatalinFetoiu
Copy link
Collaborator

closing since the issue is resolved

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

7 participants