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

How to use 'mirrored' mode since 'bridged' networking mode stopped working with 23H2 (WSL 2.1.5) #11291

Open
1 of 2 tasks
Boilerplate4u opened this issue Mar 12, 2024 · 12 comments
Labels

Comments

@Boilerplate4u
Copy link

Boilerplate4u commented Mar 12, 2024

Windows Version

Microsoft Windows [Version 10.0.22631.3155]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

6.2.7

Distro Version

Alpine Linux 3.17.3

Other Software

No response

Repro Steps

Config file .wslconfig

networkingMode = bridged
vmSwitch = WSL-Switch

Expected Behavior

The "bridged" networking mode as in the config below ceased to function with the 23H2 update, likely due to the introduction of the new "mirrored" mode.

networkingMode = bridged
vmSwitch = WSL-Switch

However, regarding the "mirrored" mode, the documentation only states that "Enabling this changes WSL to an entirely new networking architecture which aims to 'mirror' the network interfaces you have on Windows into Linux, to add new networking features and improve compatibility." Unfortunately, there are no manuals available explaining the technical details of how to use "mirrored" mode!

Question:

  1. How can I re-enable functionality using "networkingMode = bridged" and "vmSwitch = WSL-Switch" ?
  2. Or how to achieve the same effect using "networkingMode = mirrored"?
  3. If possibe, please provide en example and where to find tech docs regarding how to use "mirrored" mode

Thanks in advance!

Actual Behavior

Config file .wslconfig

networkingMode = bridged
vmSwitch = WSL-Switch

Doesn't work anymore and eth0 is not available in bridge mode.

Diagnostic Logs

No response

Tasks

No tasks being tracked yet.
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.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 12, 2024

/logs

@Boilerplate4u
Copy link
Author

Basic environment info

PS C:\> $PSVersionTable                                                                                                                                                                                                        Name                           Value                                                                                    ----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\> wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296

@Boilerplate4u
Copy link
Author

Test #1 is failing after the recent WSL update when using the original bridged/vmSwitch options. Please see the attached Test-run-1-2024-03-16-1535.zip with configuration file and logs.

[wsl2]
processors=2
debugConsole=true
# networkingMode = mirrored
networkingMode = bridged
vmSwitch = WSL-external
ipv6 = false
dhcp = true

@Boilerplate4u
Copy link
Author

Test #2 also fails when using mirrored network mode. WSL neither automatically assigns an IP address using DHCP nor establishes LAN contact when a static IP address is manually assigned to the Linux interface. While I'm familiar with troubleshooting network issues using tools like Wireshark and tcpdump, the lack of in-depth WSL documentation makes this a challenging 'black box' scenario.

Please see the attached Test-run-2-2024-03-16-1540.zip with configuration file and logs.

[wsl2]
processors=2
debugConsole=true
networkingMode = mirrored
# networkingMode = bridged
# vmSwitch = WSL-external
ipv6 = false
dhcp = true

@Boilerplate4u
Copy link
Author

An interesting observation worth mentioning is that, since I've enabled debugConsole=true, I've noticed that WSL sometimes activates and then stops automatically when I for example launch File Explorer. I've also seen this behavior intermittently when using the pipe command, like "dir xxxx | less" but also on other occasions. However, it's quite difficult to pinpoint exactly when or why it occurs.

Any ideas why this might happen?

@Boilerplate4u
Copy link
Author

Boilerplate4u commented Mar 19, 2024

Is there any in-depth documentation explaining the internal workings of mirrored networking mode for WSL and Linux?

Specifically, I'm interested in how the network interfaces are mapped between the two systems and the available control capabilities like broadcasting etc. How can I make the Windows network interface completely transparent (i.e., without impact of the Windows firewall). How and where (ie in Windows or Linux) should IP addresses be assigned using DHCP or statically?

Thanks in advance!

@Boilerplate4u Boilerplate4u changed the title How to use "mirrored" mode as "bridged" networking stopped working with 23H2? How to use 'mirrored' mode since 'bridged' networking mode stopped working with 23H2 (WSL 2.1.5) Mar 19, 2024
@chanpreetdhanjal
Copy link

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

It should create a folder like [WslNetworkingLogs-date_ver.zip]

@jcrben
Copy link

jcrben commented May 23, 2024

I'm interested in this because I'd like to use mirrored instead of bridged as bridged` isn't officially supported, but @Boilerplate4u bridged is working for me fyi

Snippet of output from fastfetch:

OS: Windows 11 (Pro) x86_64
Host: 82V2 (Slim 7 ProX 14ARH7)
Kernel: 10.0.22631.3593 (23H2)

wsl --version:

WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link

bridged networking mode is working

wsl --version
WSL-Version: 2.2.4.0
Kernelversion: 5.15.153.1-2

Doesn't work anymore and eth0 is not available in bridge mode.

Also, eth0 is available in bridge mode.

@jcrben
Copy link

jcrben commented Jul 31, 2024

Following up on this - I'm now getting flakiness in my dns resolution. I tried hardcoding the nameserver to 1.1.1.1 or 8.8.8.8 or whatnot which seems like it helped a bit. I seem to get about a minute of good resolution before it starts getting flakey. See #11326 (comment)

dns resolution issues go away if I switch to normal from bridged.

ben@lenovo-legion ~$ wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.3880
ben@lenovo-legion ~$ cat ~/.wslconfig
[wsl2]
networkingMode=bridged
vmSwitch=myswitch1
dnsTunneling=false

@MohaAmiry
Copy link

did you find a way to make mirrored mode works?
it doesn't mirror the interfaces if i enable it.

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

6 participants