NetworkManager version 0.7, shipped with Ubuntu 8.10 and later, contains a redesigned user interface for managing network connections.

Among the new features and UI is an option to make a connection ?Shared to other computers?. This is basically a dead-simple NAT (Network Address Translation), or Internet connection sharing, built right in to NetworkManager.

To enable this, you must follow three steps:

  1. Install dnsmasq on your computer. (On Ubuntu, you will want to install the dnsmasq-base package.
  2. Make sure your WAN connection (i.e. Internet-connected connection) is all configured (e.g. with DHCP or a static address) and working.
  3. For your LAN interface (which might be a second network card or a wireless card), select ?Shared to other computers? in the IPv4 Settings tab.

If everything works right, NetworkManager should have auto-configured a subnet and DHCP server on your LAN interface, and is ready for sharing your Internet connection. Easy peasy!