Connecting to WSL2 server via local network

preview_player
Показать описание
WSL2 comes by default in NAT mode. There the wsl2 system has another ip in another subnet than the host. The PC is from external peers only visible by the windows IP and the wsl2 ip/net is hidden/internal. So all traffic would need to be accepted by the windows IP and then forwarded to the wsl2 ip (port forwarding).

There is another mode called bridge mode. In bridge mode your network interface card will be shared to the wsl2 system, and it will get its own IP/Net in wsl2. So in effect your network card is shared to both systems (windows / wsl2) and will have two IPs, as if you'd have two systems with its own network card each. Cool thing: You will never have port conflicts when Windows uses the same port as well, as your wsl2 app (like 111).
Рекомендации по теме
Комментарии
Автор

I spent a lot of time trying to find how to manage Windows 11 pro with wsl2 in bridge mode. Thank You!

Webdiffusion
Автор

nice tutorial, if i use with netplan is it okay ?

alanzulwas
Автор

I dont konw if it will help me, but man, the music is WOOOOWW!!! I ll edit this later :3

alimaiee
Автор

Thanks for the video, I tried to do it after a lot of work it worked I got internet access to WSL2 via bridge network BUT after rebooting all the configuration was lost !!! all for nothing .... is there a way to keep/save the configuration ? !
btw the font/interface is amazing can you put the reference for it's configuration in the video description please ?

tsarkim
Автор

The problem is that it doesn't save.

jvc
visit shbcf.ru