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

Multiple network interfaces, one of them bridged #9113

Open
J0las opened this issue Nov 3, 2022 · 3 comments
Open

Multiple network interfaces, one of them bridged #9113

J0las opened this issue Nov 3, 2022 · 3 comments
Labels

Comments

@J0las
Copy link

J0las commented Nov 3, 2022

Is your feature request related to a problem? Please describe.
I would like to use WSL in a private local network with a bridged adapter as well as retaining the orginal network inteface for internet access over the host.

Describe the solution you'd like

  1. First connect the host to two network.
    a. Using inteface0 to connect to a network with a router that allows internet access, also used for the host.
    b. Using inteface1 to connect to a private network with its own dhcp server and no connection to other networks.
  2. Create a special hyper-v switch that is using the external mode connected to interface1.
  3. Configure WSL to use both the default switch with nat and the special switch in bridged mode preferably distribution specific in /etc/wsl.conf instead of a global setting in .wslconf.
  4. Both Networks are accessible through eth0 and eth1 respectively within WSL.

Describe alternatives you've considered
Currently only access to one network is possible through the setting [wsl2] networkingMode = bridged vmSwitch= SPECIAL_SWITCH in the global .wslconf Commenting it out when the default networking setup for internetaccess is required which in turn requires a restard of WSL as a whole.

@J0las J0las added the feature label Nov 3, 2022
@avselang
Copy link

image
I want to use two network in wsl.For example,they are "wan_switch" and "wifi_switch".As shown in the figure, I have set up the virtual switch on hyper-v.What should I do? How to set on the. wslconfig file?networkingMode=bridged vmSwitch=wan_switch,wifi_switch,Is that so?

@SunJingmin
Copy link

I had the same problem

@platonef
Copy link

platonef commented Nov 23, 2023

I face the same problem because I would like to use simultaneously a USB serial device in my Linux WSL and an Ethernet connection again in my Linux WSL which has to be connected through my host's ethernet network device by setting the Linux's WSL network mode to "bridged". After setting the network mode to bridged, I loose the USB connection because the USB connection needs another vmswitch.

FYI @craigloewen-msft

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

4 participants