How to enbale two bridged NICs in WSL?

Lee Chalienge 0 Reputation points
2023-11-22T11:44:30.1633333+00:00

Basic Environment

  1. Windows 11, using WSL2(ubuntu 18.04 x64) to work with a ROS application devopment.
  2. And there is a native ubuntu 18.04 on my pc.
  3. The AIO app needs to connect to 2 things, the artifactory service(on the internet) and the robot by a CAT-6 cable directly.
  4. To connect to the robot from Ubuntu,
    1. the IP address of the NIC on PC which is directly connected to the robot must be 10.0.20.100
      1. the IP address of the robot must be 10.0.20.201
  5. Unable to modify the AIO app
  6. So there are 2 NICs in my computer, the WLAN NIC is connected to the internet while the LAN NIC is connected to the robot.

AIO app workflow

Step 1: Connect to the robot

Step 2: Connect to the artifactory service and pull a ROS bundle(includes the data collection app) to local disk

Step 3: Install the ROS bundle to the robot from local disk

Step 4: Send a command to the robot and start the ROS

Step 5: Send a command to the robot and start the data collection app on the robot

Step 6: Get data from the data collection app on the robot

User's image

Problem

the AIO app works well on native ubuntu, but it can't get any data on WSL Ubuntu.

I tried many network configations and the status are in the 2 tables below.

If we can use 2 NICs in bridged mode on WSL, there probably be a way to work.

However, I can't find any tutorial how to enbale 2 NICs in .wslconfig file.

So how to get it work? Thanks!

Profile 1 2 3 4 5 6 7
OS Native Ubuntu 18.04 x64 WSL2 Ubuntu 18.04 x64 WSL2 Ubuntu 18.04 x64 WSL2 Ubuntu 18.04 x64 WSL2 Ubuntu 18.04 x64 WSL2 Ubuntu 18.04 x64 Hyper-V VM Ubuntu 18.04 x64
WSL Network Mode N/A NAT NAT mirrored bridged bridged briged
LAN NIC on WSL N/A DHCP 10.0.20.100 10.0.20.100 10.0.20.100 N/A 10.0.20.100
LAN NIC on Windows 10.0.20.100 DHCP 10.0.20.101 10.0.20.100 10.0.20.101 N/A 10.0.20.101
WLAN NIC on WSL N/A N/A N/A DHCP N/A DHCP DHCP
WLAN NIC on Windows DHCP N/A N/A DHCP N/A DHCP DHCP
Comments LAN NIC on WSL=Virtual NIC LAN NIC on WSL=Virtual NIC LAN NIC on WSL=Virtual NIC mirrored from windows LAN NIC on WSL=Virtual NIC bridged to Windows LAN LAN NIC on WSL=Virtual NIC bridged to Windows LAN LAN NIC on WSL=Virtual NIC bridged to Windows LAN
WLAN NIC on WSL=Virtual NIC mirrored from windows WLAN NIC on WSL=Virtual NIC bridged to Windows WLAN WLAN NIC on WSL=Virtual NIC bridged to Windows WLAN WLAN NIC on WSL=Virtual NIC bridged to Windows WLAN
Step Detail Profile 1 Profile 2 Profile 3 Profile 4 Profile 5 Profile 6 Profile 7
1 Connect to the Robot OK OK OK OK OK OK OK
2 Connect to the artifactory service and pull a ROS bundle(includes the data collection app) to local disk OK OK OK OK No, but we can pull the bundle to local disk in advance OK OK
3 Install the ROS bundle to the robot from local disk OK Failed, due to wrong ip address Failed, cannot be connected OK OK, use the bundle already saved to local disk Failed, due to wrong ip address OK
4 Send a command to the robot and start the OS OK N/A N/A OK OK N/A OK
5 Send a command to the robot and start the data collection app on the robot OK N/A N/A OK OK N/A OK
6 Get data from the data collection app on the robot OK N/A N/A Failed, can't get response from the robot OK N/A OK just for only 1 second, but then can't get response from the robot
Additional test Ping the robot from Ubuntu OK OK Failed OK OK Failed OK
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,864 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,753 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.