Internet Connection Sharing in Ubuntu 12.04 Precise Pangolin

Source: http://askubuntu.com/questions/169473/sharing-connection-to-other-pcs-via-wired-ethernet

The case is when your laptop has internet connection from Wi-Fi, while other PC or device only has ethernet port, and you want to connect the ethernet-only device to internet through the wifi-connected laptop.

Actually it’s quite easy – compared to 5-10 years ago when we have to fiddle with iptables and masquerading. Here’s what we have to do on the laptop:

1. Click on the Network Manager Applet (on top right of the screen), then select “Edit Connections”.

2. On the “Wired” tab, select the “Wired Connection 1” or whatever it might be, then click on “Edit” button on its right side.

3. Move to “IPv4 Settings”, change the “Method” drop-down into “Shared to other computers”.

4. Done.

 

Then on the other device, just plug the ethernet cable, then it will do the rest automatically, absolute hassle-free.

 

In case it doesn’t work like that, do this first on the laptop:

$ sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0

then on the device:

$ sudo ifconfig eth0 192.168.0.2 netmask 255.255.255.0

Then set the gateway, pointing to the laptop’s address:
$ sudo route add default gw 192.168.0.1

Advertisements
Leave a comment

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: