How to do Internet Connection Sharing on Linux
Summary: Use Firestarter
I have been using a 3G modem and needed to hook up one more computer to it. In Windows XP you can use Internet Connection Sharing that will e.g. share the Internet connection out via the Ethernet port. In this way the Windows machine connects to the Internet via a 3G modem (or Wi-Fi) and the other machine is connected via an Ethernet cable and the Windows computer takes care of giving the other computer a private IP number and transparently routes the traffic from that computer to and from the Internet. It is very handy. You can have several computers behind the Windows machine as well. However the Windows connection to 3G kept crashing and I knew my Linux 3G connection is super stable.
So how do I go about routing the other way around, i.e. to use the Linux computer to connect to the Internet and then take care of dishing out the Internet to the Windows computer (or any number of computers)? The easiest route (pun intended) I found was to download and install a firewall called Firestarter on Linux. Firestarter has a big shiny button for doing Internet connection sharing.
Well, it's actually a normal sized check box...
If you want your Linux machine to dish out dynamic private IP numbers (or several) on the private network, you also need to install a local DHCP server on the Linux machine. It will be automatically detected by Firestarter.
Om Ubuntu Linux 8.04 I installed Firestarter like this:
sudo apt-get install firestarter
and then the dhcp server (I did this one from synaptic, the GUI to apt-get). It was very easy.