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

Can't Use Multiple NICs with WSL2 #8504

Closed
1 of 2 tasks
anaszgh opened this issue Jun 13, 2022 · 4 comments
Closed
1 of 2 tasks

Can't Use Multiple NICs with WSL2 #8504

anaszgh opened this issue Jun 13, 2022 · 4 comments

Comments

@anaszgh
Copy link

anaszgh commented Jun 13, 2022

Version

10.0.20348.740

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu 18.04

Other Software

No response

Repro Steps

1 - On a device with multiple NICs install WSL2
2 - Install Ubuntu 18.04 distro
3 - Open Ubuntu and type ifconfig
4 - You'll see only one network registered

Expected Behavior

To have all the network capabilities of the host OS, currently any incoming traffic to the second NIC is not received by the WSL

Actual Behavior

Currently, WSL configured a single network for one of the NICs, any incoming traffic to the second NIC is not received by the WSL

Diagnostic Logs

No response

@elsaco
Copy link

elsaco commented Jun 13, 2022

@anaszgh in an elevated console type hnsdiag list all to show WSL networking info. There's only one endpoint created for all WSL instances. You notice each WSL instance has the same IP, GW, route, etc.

PS C:\> hnsdiag.exe list all
////////////////////////NETWORKS///////////////////////

Network : B95D0C5E-57D4-412B-B571-18A81A16E005
    Name             : WSL
    Type             : ICS
    Subnet Address   : 172.23.176.0/20
    Gateway          : 172.23.176.1

///////////////////////ENDPOINTS///////////////////////

Endpoint         : c7b65d67-afb3-47bc-b7de-4bed1ed5a0a8
    Name             : Ethernet
    IP Address       : 172.23.188.159

//////////////////////NAMESPACES///////////////////////

Namespace        : 910f7d92-ba2d-4c3f-98ae-7c0ac590d2dc

/////////////////////LOADBALANCERS/////////////////////

I think this is by design. So far I didn't find a way to create multiple endpoints and assign individually to WSL instances, or bind to different host network ports. MS won't let us see the code for init either!

@ghost ghost added the network label Jun 13, 2022
@anaszgh
Copy link
Author

anaszgh commented Jun 14, 2022

@anaszgh in an elevated console type hnsdiag list all to show WSL networking info. There's only one endpoint created for all WSL instances. You notice each WSL instance has the same IP, GW, route, etc.

PS C:\> hnsdiag.exe list all
////////////////////////NETWORKS///////////////////////

Network : B95D0C5E-57D4-412B-B571-18A81A16E005
    Name             : WSL
    Type             : ICS
    Subnet Address   : 172.23.176.0/20
    Gateway          : 172.23.176.1

///////////////////////ENDPOINTS///////////////////////

Endpoint         : c7b65d67-afb3-47bc-b7de-4bed1ed5a0a8
    Name             : Ethernet
    IP Address       : 172.23.188.159

//////////////////////NAMESPACES///////////////////////

Namespace        : 910f7d92-ba2d-4c3f-98ae-7c0ac590d2dc

/////////////////////LOADBALANCERS/////////////////////

I think this is by design. So far I didn't find a way to create multiple endpoints and assign individually to WSL instances, or bind to different host network ports. MS won't let us see the code for init either!

I can create a new virtual switch and assign it to a specific wsl distro (using wsl.conf) or make global default by updating .wslconfig file.

But the problem that i'm unable to specify multiple virtual switches.

the case is as follows

I have to NICs each assigned a different IP Range
NIC1: 192.168.1.222
NIC2: 192.168.3.222

for example if assign the virtual switch of NIC1 to the wsl, it will not be able to access anything accessible from NIC2, and vise-versa.

Is there a way to make it possible to access both NICs?

For example, NIC2 connected to an RTSP Camera, and i want the wsl to able to consume the video.

@ghost
Copy link

ghost commented Jun 14, 2022

This is by design, closing issue.

@ghost ghost closed this as completed Jun 14, 2022
@ghost ghost added the bydesign label Jun 14, 2022
@the-moog
Copy link

the-moog commented Feb 7, 2023

Not often you see the "It's not a bug, it's a feature put into a large scale commercial deployment" What moron made that design decision?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants