Sharing Internet connection trough an ethernet card with Ubuntu

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.

If you have more than one network card (eg: wireless and ethernet like in a normal laptop) you can decide to 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. :-)

For example 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 recognized after a fresh install.
I needed then to install a package to make the USB wireless card to work but, as I said, I had no Internet. This is a classic scenario in the Linux world, isn't it? :-)
I type too much, I know. This was supposed to be a very short post... LOL

So, this is how you do it.
System -> Preferences -> Network Connections
Click on the tab "Wired" (if it's not already selected) and add or edit an existing connection. In my case I'm editing the connection called "Share eth0".
NetworkConnections window - Ubuntu Lucid

Once you clicked on add/edit another window will pop up:
Edit Network Connection - Ubuntu Lucid

After having given the connection a name (in case you are creating it) the only thing left to do is to set the method for the IPv4 Settings to "Shared to other computers" like in the picture above.

You might have to restart the service or the machine. In my case it worked without.

Enjoy sharing...

NB: I've tested it on Ubuntu Lucid but it should work also on the most recent distributions.

Leave a Reply

Your email address will not be published.