Skip to main content

enabling bridged networking

 

https://randombytes.substack.com/p/bridged-networking-under-wsl

https://github.com/microsoft/WSL/issues/4150#issuecomment-1018524753

Install Hyper-V manager first, create an external virtual switch.

 

image.png

After that, edit the `.wslconfig` file (https://learn.microsoft.com/en-us/windows/wsl/wsl-config)

cd ~
notepad.exe .wslconfig

# edit wslconfig with below content

wsl --shutdown
[wsl2]
networkingMode=bridged
vmSwitch=ws1-sw