Networking with the Windows Subsystem for Linux

Networking was built in on the Ubuntu WSL install. WSL Ubuntu under Windows has an IP of 172.17.xxx.xxx, but it can see my local 192.168 network, and the entire internet. WSL Ubuntu says it uses a DNS Server on the 172.17 network. Since WSL uses NAT, I expect that translates to my router on the 192.168 network, which in turn accesses the DNS servers of my ISP. IP addresses in the range 172.16.0.0 to 172.31.255.255 are private, so apparently WSL creates its own network.

The WSL install process was obliging enough to import my Windows hosts file into the Ubuntu /etc/hosts. I have edited out the line for the machine itself, since there may be a problem with two IP addresses for the same DNS name. Or not. I am not a network expert so I do not really know.

This is still only a text mode system, but with the lynx browser I am able to access the web. Back in my early days on the Internet (1992-1998) that was all I had. Another program I used in those days was the ncftp ftp client. I have installed that on WSL Ubuntu as well. I probably will not go so far as to install a text-mode email client like the one I used back then, and in fact until 2016!

So WSL can access the outside world. If I go to Windows on the same machine I can ping that 172.17 IP address, so I expect I can reach it by other tools. E.g. I could set up an ftp server there and load files to it from Windows. I cannot ping it from another machine on my 192.168 network, so the WSL network only extends as far as the host machine. Fun question: If I installed another version of Linux on this WSL system would it be able to see the current Ubuntu environment? I.e., would it be on the same 172.17 network?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.