A PhoneBoy Primer On: Sharing an Internet Connection

Sharing printers and files is nice. So is being able to play network games. One of the best reasons I have seen to network your home computers is to share an internet connection between them. Instead of needing a seperate ISP account for each system, you can use one ISP account to dial up and allow all the computers in your house to access the Internet at once. While this is the most effective with high-speed connections like Cable Modems, ISDN, or DSL, it is still quite useful with just your average high-speed modem as well.

When your computer is on a TCP/IP-based LAN, it has an IP address that identifies it on the network. When a computer on a LAN is also connected to an Internet Service Provider, it has two IP addresses -- one provided by the local LAN, and the other provided by the ISP. A computer that is physically connected to two or more different networks is called "multi-homed." So how does this "multi-homed" computer know where to go when it needs to talk to another computer? The TCP/IP software has what is called a routing table that keeps track of the various TCP/IP networks and makes sure traffic gets "routed" to the correct machines.

Usually, a "multi-homed" machine can automatically route network traffic between any network it is attached to. In most cases, however, this will not work. First of all, if your "multi-homed" machine is running MacOS or Windows 95, these OSes do not automatically route network traffic, even if they do exist on multiple networks. Second, the IP addresses you are most likely using for your LAN either are in use by someone else on the Internet or they are private network addresses that can not be used on the Internet. So while you may be able to send stuff out to the Internet, stuff will not get back to you.

Since most ISPs will only give you one IP address when you connect to them, there needs to be some way that requests from your LAN that are supposed to go to the Internet get rewritten in such a way that they look like they are coming from the machine that is directly connected to the Internet.

Proxy Servers

The easiest way to do this is to set up a Proxy Server on the multi-homed machine.

To understand what a Proxy Server does, let me make an analogy. Let's say Bob wanted to call someone on the telephone. He has a condition that makes it so he can't hear or talk to people on the telephone. Anytime he needs to talk to someone on the telephone, he has his wife Holly do it for him. Bob tells Holly what he wants to say and Holly says it for him. Holly relays the information back to Bob. This is basically what a Proxy Server does -- it takes requests from one place and makes them on their behalf. It also relays back the responses. A proxy server can also cache certain types of requests so that if it is made again, it can be served locally without having to go fetch it from the network. It can also restrict who can access what, which is a feature that many corporations use.

The problem with Proxy Servers is that some applications have to be made aware of proxy servers that may be in use. Fortunately, a lot of common applications that take advantage of the Internet can be configured to use a proxy server or a firewall. The most common sort of proxy server implementation is called "SOCKS", which you might see listed when you go into a program's configuration screens. Once you've configured the applications to use the Proxy server, the applications work as if you were directly connected to the Internet.

The machine that runs your proxy server will need to be running the proxy server any time you want other computers on your LAN to be able to access the Internet, though the machine running the proxy server can also be used for other tasks. It should have additional memory to run the Proxy Server software unless it is a dedicated system. I would recommend at least 32 megs of RAM under Windows 95 or NT (other OSes may vary).

I have a dedicated system that allows my LAN to access the Internet. While I have a proxy server set up on this machine, I rarely use the proxy server. This machine uses another method to allow my LAN to talk to the Internet, which I will get into next week when I talk about my own LAN setup.

If you're interested in looking at a proxy server for your LAN on Windows, check out these links for Win9x and WinNT.

Network Address Translation

Another, cooler approach is something called network address translation (or NAT). NAT takes network traffice from any address and make it look like it is coming from or going to a different address. Effectively, it allows me to use "private" networks as defined by RFC-1918 and still talk to the Internet. All of this happens on the multi-homed machine that sits between the Internet and the LAN. Large corporate networks and/or sites with a limited number of legal Internet address will use NAT to allow their corporate users to access the Internet and provide services without have to give each system a legal Internet address.

NAT is completely transparent to most client software, though you will have to set up the TCP/IP on your LAN systems to have its "default route" set to the IP address of the machine on your LAN that does the NAT. There are a few options for this:

Linux (with kernels 2.0 and later) can do NAT, though you may need to recompile your kernel to enable all the features. I started using this at home ever since the hard drive in my main PC crapped out. I now have a dedicated machine running in this configuration and it works fabulously.

It's not for Everyone

Admitedly, setting up networking and sharing an Internet connection is not for everyone. Not everyone needs to do this. And it's certainly not easy. But if you need quick and easy access to resources on one of your computers from another, or you want to share an ISDN connection, this is definately something you should look into.


Last Update: 20 June 1999
Return to PhoneBoy's Internet Guide