Issue
WSL 2 seems to NAT it's virtual network, instead of making it bridged to the host NIC. My goal is for a service running in Ubuntu in WSL 2 to be accessible from anywhere on my local network.
Issue Details
IPv4 Address. . . . . . . . . . . : 192.168.1.41
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Running ifconfig in Ubuntu WSL 2
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.72.60 netmask 255.255.0.0 broadcast 172.18.255.255
Accessing 172.18.72.60 from my Window host does work, however this IP is not accessible from another system on my network.
-
What's wrong / what should be happening instead:
I would expect to ifconfig in Ubuntu WSL 2 to have an IP address in the same network as my host machine.
-
Searching the docs:
The only detail I have found about WSL 2 networking is the following that notes that it will have it's own IP and that localhost is something that will be used for WSL 2 in the future.
https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes
This is fine, however I would like the IP WSL 2 is getting to be on my local LAN which means I need to configure the virtual NIC to be bridged.
Workaround
See @edwindijas #4150 (comment)
Issue
WSL 2 seems to NAT it's virtual network, instead of making it bridged to the host NIC. My goal is for a service running in Ubuntu in WSL 2 to be accessible from anywhere on my local network.
Issue Details
Your Windows build number:
Microsoft Windows [Version 10.0.18917.1000]What you're doing and what's happening:
Running
ipconfigon my Windows 10 host machineRunning
ifconfigin Ubuntu WSL 2Accessing 172.18.72.60 from my Window host does work, however this IP is not accessible from another system on my network.
What's wrong / what should be happening instead:
I would expect to
ifconfigin Ubuntu WSL 2 to have an IP address in the same network as my host machine.Searching the docs:
The only detail I have found about WSL 2 networking is the following that notes that it will have it's own IP and that localhost is something that will be used for WSL 2 in the future.
https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes
This is fine, however I would like the IP WSL 2 is getting to be on my local LAN which means I need to configure the virtual NIC to be bridged.
Workaround
See @edwindijas #4150 (comment)