jump to navigation

How to share your Internet connection on Ubuntu 12/18/2008

Posted by ubuntunigeria in Connectivity, Uncategorized.

For many moons ever since i started using Linux i have always wanted an easy way to share my internet connections between two computers. anyway i finally found a way to get it to work. Now i can share internet connection between my work laptop and my personally laptop.

Please while it might be possible on some other laptops. my laptop came with the PRO/Wireless 3945ABG and its impossible to share my internet over wireless because the current driver for my device doesnt support master mode which is what is needed for this to be possible. But with this guide it would be possible to share intenet via Lan. so if you get your intenet connection over wlan or a 3g modem or anything modem. it would be possible to share that same internet over Lan. Note if you got your wifi to work through ndiswrapper then we are also in the same shoes and sharing via wifi wont work. Infact this post is not about sharing your internet via wifi period.

Ok enough talk. To get started we would need tool packages. Firestarter and dhcp both can be installed with this command

sudo apt-get install firestarter dhcp3-server

Next we need to configure the internal Network Card that other computers get their internet from. In my case since the shaing computer gets internet from Wifi my internal network card (i.e the card other computers would be getting their internet from) would be eth0. we need to configure the card and assign a static IP address in a range that you will use for your internal network card. so rightclick on the Network manager applet and select edit

click the wired tab and select Auto eth0 (or the card of the particular card you want to coonfigure as the sharing interface) and click edit.


now select IPv4 Settings and choose Manual. now Add

and set it up to your preference. for example i set like this IP address to, and the subnet mask to Leave the gateway empty.

Now we need to fix a problem where firestarter cannot locate the DHCP daemon script

so we open a terminal and run this command

sudo ln -sf /etc/init.d/dhcp3-server /etc/init.d/dhcpd

Next we configure the interface that DCHP will be listening to.

To do this we need to edit this file /etc/default/dhcp3-server

gksu gedit /etc/default/dhcp3-server

only variable in there by default is “INTERFACES”, which will have a null value. Set it to your internal network interface. For example:

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

# This is a POSIX shell fragment

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. “eth0 eth1”.

save and exit

Now we run Firestarter Applications/Internet/Firestarter

A wizard should appear Select your Detected Device (Internet-connected) if your sharing computer gets its Internet via wifi then your external device would mostly be wlan0. if you are connected via a modem then it would be ppp0 device when it asks, and make sure to specify whether or not the address is obtained via DHCP. Click the “Forward” button, check the “Enable Internet connection sharing” box, select your internal network card,”Start firewall now” box, Then click on Preference and and Network settings.

“Enable DHCP for local network”. Drop down the “DHCP server details” and enter the range of IPs you would like for it to dynamically assign. Make sure they are in the same range as the static IP you set for your internal network card. You can leave the DNS field as “” Click “Forward”, check the “Start firewall now” box, and click “Save”.

“Enable DHCP for local network”. Drop down the “DHCP server details” and enter the range of IPs you would like for it to dynamically assign. Make sure they are in the same range as the static IP you set for your internal network card. You can leave the DNS field as “” Click “Forward”, check the “Start firewall now” box, and click “Save”.

At this stage am able to ping the from the other computer but am unable to access the internet. to fix this we need to add “net.ipv4.ip_forward = 1” to /etc/sysctl.conf

to /etc/sysctl.conf

gksu gedit /etc/sysctl.conf

and add this at the bottom

net.ipv4.ip_forward = 1
save and close.

now if all goes well you will be able to share your Internet to another laptop or computer. hope this helps some body



1. John - 12/29/2008

Awesome! Xbox 360 via wifi, for free! Thank you so much.
To others: This took me a while because I didn’t read all of the directions first. It would have gone a lot faster if I did.

Thanks again!


2. storage networking - 01/19/2009

It’s been the conventional wisdom of the past 10 years that to provide the best performance, protection, and capacity utilization for applications and databases, you need a robust storage array in a storage area network (SAN).

3. DASO - 02/07/2009

I did every thing you said put I can’t use the internet from the other pc that contains windows xp

please help me

4. avarashnon - 05/09/2009

Yes is it possible to share internet connection with windows xp?

5. jura - 06/11/2009

Very useful, thanks. I have tried few other methods before this but none of them had complete success.

Platform is not an issue with this method. If you did it right, all you have to is enable automatic addressing for DHCP on the other computer.

6. crecit - 05/07/2010


Good job! THX!

Help me your topic!

Thanks again!


7. how to configure best best wireless arris cable modem for comcast - 08/31/2014

Hi Dear, are you in fact visiting this web page regularly, if
so after that you will without doubt take pleasant experience.

8. dgn2200 tomato firmware dd wrt - 08/15/2016

What’s up friends, its fantastic paragraph about teachingand
fully defined, keep it up all the time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: