Doing it Backwards - Internet Connection Sharing Between Linux and Windows

Sep 1, 2002    Write an essay on this topic.


The Bottom Line Connecting Linux to the Internet on a Windows Networks is easier than you may think.

This is a public service announcement. I am writing this little piece because when I needed help getting my Linux computer connected to the Internet, nobody seemed to have the definitive answer. The answer itself is trivial. You just might kick yourself when I tell you what it is.

The Problem
I have a rather old internal DSL modem. This modem has no Linux drivers. In fact, the latest drivers that are said to work effectively for my DSL modem were written for Windows 98 Second Edition. Therefore, I have only one computer in the house that can connect the rest of my network to the Internet unless I want to use a dial-up account - my husband’s Gateway PC running Windows ME. For the record, my DSL provider doesn’t even believe my husband’s PC should be able to connect because the drivers, according to them, do not work on ME.

I have two other computers in the house. One is another Windows ME box. The other is a dual-boot Windows XP, Redhat Linux machine. The ME and XP machines connect to the Internet via the Gateway using Microsoft Internet Connection Sharing. The problem was, how to get the Linux box connected to the outside world. The answer was surprisingly simple.

The Solution
Everybody’s advice was to connect the Linux box directly to the Internet and use that machine as the gateway to the outside world. Because Linux is such a rock-solid operating system, that is actually the smartest way to do things. Unfortunately, my ancient hardware didn’t give me that option.

Once a direct connection using Linux was ruled out, everybody suggested a hardware solution. It was proposed that I purchase a router for my network, and use that to manage the Internet connections for the different machines. My primary objection to that solution was cost. I did not want to buy any more hardware for my home network.

Still others proposed that I needed to purchase proxy server software for the Gateway machine. I tried a trial version of WinProxy, but that merely messed up my DSL connection. Given that my DSL connection, in theory, isn’t supposed to work anyway, I decided that it was safer not to make any changes to my Gateway. If my Linux box was going to connect, the solution would have to be a Linux based one.

After quite a bit of research, and asking every Linux expert that I knew, the solution was fundamentally trivial. In fact, it is scarcely worth documenting. To understand why the solution works, it is helpful to know that fundamentally, Windows Internet Connection sharing works as a DHCP server and IP masquerading. This means that the gateway machine is responsible for giving the other machines on the network an IP address and for forwarding the Internet traffic to the appropriate machine. Therefore, if you have a Linux box on a Windows network using Microsoft’s Internet Connection Sharing, all you have to do on the Linux box is to set the Linux box up as a DHCP client. In both Redhat and Suse Linux, this is as trivial as selecting the appropriate checkbox in your network settings.

Embarrassing, Isn’t It?
I am not sure why none of the Linux gurus knew this simple answer. Granted, most normal people would not connect their machines this way. However, if you are in the same boat that I was in, enabling DHCP on your Linux box is all you need to do in order to connect to the Internet. Just make sure to set the Linux box as the DHCP client and not the server, and you should be able to surf from Linux.

Read all comments (7)|Write your own comment
Write an essay on this topic.

About the Author

amykhar
Epinions.com ID: amykhar
Member: Amy
Location: USA
Reviews written: 324
Trusted by: 479 members