Can't receive UDP multicast from WSL2 in mirrored mode, but unicast and TCP work #14357
Unanswered
robertjdac
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
WSL version: 2.6.3.0
Kernel version: 6.6.87.2-1
Windows version: 10.0.26100.7623
I am transitioning my project from running on VirtualBox to WSL2 since I can no longer remove the Green Turtle on Vbox.
I have an app that runs on Linux that does the following:
Starts a TCP server and processes data from app on Windows host
Sends UDP multicast out to Windows app, receives UDP multicast back from Windows app
Sends UDP unicast out to Windows app, receives UDP unicast back from Windows app
This worked without issue on VirtualBox when using a bridged adapter. This also works with WSL2 when using bridged networking mode. The problem is that WSL and bridged networking mode doesn't play nice with my company's VPN, so I am trying to make this work with mirrored network mode.
When I run the same test with WSL2 in mirrored mode, everything works except receiving multicast on the Windows side.
So I can connect to the TCP server and send messages; I can send/receive UDP unicast between the two apps; and the app running on WSL2 can receive the multicast from my Windows app.
But the Windows app cannot receive multicast from the WSL app.
What's strange is that I see the packets on Wireshark on the Windows side.
I tried the suggestion here #10614 to run
Set-NetFirewallHyperVVMSetting -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' -DefaultInboundAction Allowbut that hasn't helped.
I added setsockopt IP_MULTICAST_LOOPBACK on both sides just in case, but that also had no effect.
netsh interface ipv4 show joinsshows the multicast group on the correct adapter with 1 reference (my Windows app).The adapter I am using is a USB-Ethernet adapter with a static IP configured (10.2.10.1, 10.20.10.2). I've tried using 0.0.0.0 and also the explicit interface, no difference.
I also tried adding a route on the Linux side (sudo route add 224.0.2.200/32 dev eth1, where eth1 is my USB-Ethernet adapter), and it shows the metric as 0. I also tried without this route.
My .wslconfig looks like:
[wsl2]
memory=16GB
processors=12
swap=2GB
dnsTunneling=true
networkingMode=mirrored
firewall=false
[experimental]
hostAddressLoopback=true
(I had to enable hostAddressLoopback, without it then the TCP and unicast didn't work either).
(I also disable my VPN before running - if it's active, then nothing works. But if I disable it, the TCP, unicast and Windows multicast->WSL works)
Beta Was this translation helpful? Give feedback.
All reactions