Simple Internet connection sharing with NetworkManager
This article is based on jeremy.visser.name/2009/03/24/simple-internet-connection-sharing-with-networkmanager/ at and appears here under a Creative Commons Attribution-Share Alike 3.0 License
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:
- Install dnsmasq on your computer. (On Ubuntu, you will want to install the dnsmasq-base package.
- Make sure your WAN connection (i.e. Internet-connected connection) is all configured (e.g. with DHCP or a static address) and working.
- 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!