If you have more than one network card (wireless and ethernet, like in a normal laptop) you can share your Internet connection with another computer via the ethernet cable. “When should I need such a thing?” you say. I know, I know… let me explain. :-)
The other day I was working on a Linux laptop that doesn’t have an integrated wireless card and the USB one had not been recognised after a fresh install. I needed to install a package to make it work but had no Internet. Classic Linux chicken-and-egg problem, isn’t it? :-)
Here is how you do it. Go to System > Preferences > Network Connections, click on the “Wired” tab and add or edit an existing connection. In the IPv4 Settings tab, change the “Method” to “Shared to other computers”.


If the graphical tool is not available, you can also set this up from the command line:
sudo ifconfig eth0 10.42.0.1 netmask 255.255.255.0 up
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
This gives the connected machine an IP in the 10.42.0.x range and forwards traffic through your wireless interface.
Enjoy sharing!