Usage scenario
This setup is targeted to improvised setups where you need to share out a wireless or mobile connection on your laptop, to a number of computers on a wired network. Instead of using any built in ICS (Internet Connection Sharing) in your laptop's OS, with this solution you start a virtual machine ("device") that takes care of it all. In this way the ICS services are insulated from your laptop, and no changes to the routing on your laptop is needed.
I have only made initial tests with the setup, using two laptops, both running Ubuntu Linux 10.10, and pulling down the Internet over Wi-Fi and putting the local computer on a wired connection from the other latop.
How it works
A small (256 MB RAM) pre-configured Ubuntu Linux is running as a virtual machine under Virtualbox on your laptop. The virtual machine takes care of the Internet Connection Sharing, dishing out IP numbers and handling DNS for any number of computers connected via the wired network and routing their traffic on to the Internet.
In Virtualbox you can easily change the interface on your laptop used for the local connection. The Internet connection is handled automatically.
Your laptop is connected to the Internet via a mobile connection or a wireless connection.
Step by step guide:
Now it should all work, check that the client computer can connect to the Internet.
You can now install a switch instead of the client computer and then hang as many client computers as you want off that switch (as many as the configured range of dnsmasq allows, 250 according to the example on the instructions page above).
Trying other operating systems and solutions
I first tried Internet Connection Sharing Appliance | Virtual Appliance Marketplace , but could not get it to run the way I wanted. It is also a bit old, from 2006.
I then tried puppy Linux 2.2.0 from here. I could not figure out how to install a dhcp server and I realised I did not want to learn another package system. However ICS was very straight forward since it is a part of the Puppy firewall wizard.
I then tried Debian, but installations failed due to not being able to partition the disk, due to corrupt packages, not finding the kernel and not being able to install the bootloader respectively. All or some of these may have been due to overconservative parameters for disk size.
I then tried m0n0wall, but realised it was not open source, then tried Zeroshell but that one did not have a wizard for ICS so in the end I went with the for me more familiar Ubuntu instead.