Skip to content

Only one lo network card with networkingMode=mirrored #10650

Closed

Description

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!

Activity

  1. FlowerBirds commented on Oct 20, 2023

    @FlowerBirds
    Author

    image

    image

  2. Yolo-plop commented on Nov 8, 2023

    @Yolo-plop

    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.

  3. keith-horton commented on Nov 14, 2023

    @keith-horton
    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!

  4. Ynewtime commented on Nov 16, 2023

    @Ynewtime

    Same issue here only when configured with networkingMode=mirrored.

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

  5. FlowerBirds commented on Nov 17, 2023

    @FlowerBirds
    Author

    The problem still occurs in the 2.0.9 version.

  6. FlowerBirds commented on Nov 23, 2023

    @FlowerBirds
    Author

    The problem still occurs in the 2.0.11 version.

  7. FlowerBirds commented on Nov 23, 2023

    @FlowerBirds
    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 (@keith-horton) thanks.

  8. FlowerBirds commented on Nov 23, 2023

    @FlowerBirds
    Author

    wsl debug info.txt

    debugConsole=true
    
  9. CatalinFetoiu commented on Nov 27, 2023

    @CatalinFetoiu
    Contributor

    关小羽的刀 (@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

  10. CatalinFetoiu commented on Nov 28, 2023

    @CatalinFetoiu
    Contributor

    关小羽的刀 (@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

  11. FlowerBirds commented on Nov 29, 2023

    @FlowerBirds
    Author
  12. arslantu commented on Apr 5, 2024

    @arslantu

    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

  13. Ynewtime commented on Apr 5, 2024

    @Ynewtime

    Arslan Tu (@arslantu) You are unbelievable! This just solve my long lasting problem!!! Thank you!

  14. keith-horton commented on Apr 5, 2024

    @keith-horton
    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)

  15. keith-horton commented on Apr 5, 2024

    @keith-horton
    Member

    关小羽的刀 (@FlowerBirds) , can you see if the Tcpip6\Parameters DisabledComponents registry value is set on your machine?

  16. FlowerBirds commented on Apr 7, 2024

    @FlowerBirds
    Author

    Keith Horton (@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
    
  17. keith-horton commented on Apr 8, 2024

    @keith-horton
    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.

  18. CatalinFetoiu commented on Jul 26, 2024

    @CatalinFetoiu
    Contributor

    closing since the issue is resolved

  19. rliuyi commented on Sep 27, 2025

    @rliuyi

    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

    Thanks for saving my life...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions