Sharing your Internet connection is the poor man’s way of creating an access point using one of your PCs as the gateway. This implies that the PC (gateway) that you want to use for this has two network cards:
an Ethernet card (NIC) connected to a network (LAN) with Internet access
a wireless network interface card (WNIC) used to share the Internet connection
Setting up ICS on an Ubuntu machine is a very straight-forward process:
Enter the details you want for this new “ad-hoc” network. WPA is not supported, so your only options for “Wireless Security” are “None” (although I wouldn’t call this security) or the WEP settings (not a secure algorithm, but hopefully your neighbours don’t use WireShark to crack your network). For the WEP 40/128-bit Key option, you key has to be exactly 5/10/13 characters long. If you want to be able to connect Windows clients to your network, the only option that worked for me is WEP 40/128-bit Key with a 13 characters key. An Ubuntu machine won’t have any problems with either options. Click on Create. Network Manager will automatically connect to this new network you have just created.
After your PC has connected (self-connected) to the “ad-hoc” network, you have to make sure that this connection is shared to other computers and devices (clients). Right click on the Network Manager icon and select Edit Connections… Select the Wireless tab, select your recently created connection and click on Edit. Make sure that the Connect automatically check-box is selected and on the IPv4 Settings tab male sure that the Method option is set to Shared to other computers.
Ensure that you do have the
dnsmasq-basepackage installed (you can check usiny Synaptic). This is a DNS / DHCP server which will not run as a daemon, but as a background program, launched by the Network Manager.
To be sure that your clients will receive an IP check that your firewall allows connections from and to the new network you have just created. Given the following command, you should see a similar output:
1 2 3 4 5 6
Enjoy browsing! I told you this was simple.
P.S. I would like to thank Vlad for helping me correct the information provided about clients’ IPs and the fact that the gateway will provide the necessary data through DHCP.