question

mottymermelstein-9934 avatar image
1 Vote"
mottymermelstein-9934 asked renato-mon commented

can i create a bridged network for wsl2

I would like to be able to use a bridged network with wsl2. I couldn't find a way to do it.

windows-10-hyperv
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I just open Windows Network adapter properties and create bridge between local network adapter and WSL adapter. Then I add IP address to eth0 inside my Ubuntu and I see that LAN is accessable from WSL.

 # ip a add <IP>/<mask> dev eth0

then i change default route and DNS settings

 # ip r del default
 # ip r add default via <router IP>

edit /etc/resolv.conf and set your DNS (8.8.8.8?)

0 Votes 0 ·
renato-mon avatar image renato-mon AlexanderKolesnikov-4263 ·

what do you mean by

create bridge between local network adapter and WSL adapter

you cant do that in windows

0 Votes 0 ·
MicoMi-MSFT avatar image
0 Votes"
MicoMi-MSFT answered mottymermelstein-9934 commented

Hi,
I found a similar thread, you can take a look at edwindijas’s solution and check if it could help at your side:
https://github.com/microsoft/WSL/issues/4150
And this thread also may be helpful:
https://www.reddit.com/r/bashonubuntuonwindows/comments/hdmspt/using_bridged_networking_to_get_outside_access_to/

Thanks for your time!
Best Regards,
Mico Mi


If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Unfortunately, it doesn't work for me. (maybe it has to do with the home version that I am using)

0 Votes 0 ·
MicoMi-MSFT avatar image MicoMi-MSFT mottymermelstein-9934 ·

Hi, what is the home version you are using?
Best regards,
Mico Mi

0 Votes 0 ·

[Version 10.0.21277.1000]

0 Votes 0 ·
Su-6041 avatar image
2 Votes"
Su-6041 answered

Hello,

Sorry for troubling, but .. any kind of port forwarding workaround solution kind of can not fix what is asked here. As having access to the host network is something completely different from network packets / connections forwarded from a port to another port which exists only virtually somewhere in host's memory.

Is there perhaps any change Ms will reconsider this behavior? As the promoted port forwarding is inconvenient to use and also blocks the wls virtual to interact with the host network directly.

Best Regards,
Su

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.