Sharing Internet Connection with a Crossover Cable

Sometimes you want to to have two computers using the same internet connection. It’s been awhile since I last posted an Ubuntu tutorial, so it is about time. Here I discuss how to share internet access over a crossover cable.

Ok, this config would take less than a minute if I was there. Maybe it will be the same for you if you can cut and paste fast. It can be done graphically and you might want to try it for fun. The fun part about Ubuntu is that you can experiment and there is nothing better than just figuring things out.

Open a terminal and type this:

sudo cp /etc/network/interfaces /etc/network/interfacesbkup

That backed up the file we are going to work with and then this:

sudo gedit /etc/network/interfaces

Now you are going to add the setting for your network. A file will get opened in your editor. Look in the file and you will see this line:
#iface eth0 inet dhcp

Right above it you will see a line that says auto eth0. Don’t touch that line. You want to delete the #iface line and put this in its place:
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0

This sets the ip address of your LAN connection. Save the file and then exit from gedit.

Now, hook up the cable that goes between your computer and your wife’s computer then just restart networking by typing this in a terminal:

sudo /etc/init.d/networking restart

Now you are ready to use the connection.

1st, do a google search to make sure you have still internet. (IE see something went wrong). It also checks to see if we need to do any default networking.

2nd, is the other computer using Ubuntu or Windows. If the other computer is using Ubuntu as well, just change her /etc/network/interfaces file in the same way I described above, but just change the address, to 192.168.1.2 and add these lines:
gateway 192.168.1.1
dns-nameservers 192.168.1.1

If the other computer is using Windows, go into the TCP/IP properties of the connection and untick the automatically get IP address and auto nameservers. For ip address enter 192.168.1.2 , tab through the mask and for gateway use 192.168.1.1 and for dns, use 192.168.1.1

Now check if the other computer has internet. and check if you have internet. You should both be set.

Problems?
Send me another copy of your ifconfig
If for some reason you lose internet on your Ubuntu, run this command:

sudo rm /etc/network/interfaces

and then

sudo mv /etc/network/interfaces/networkbkup /etc/network/interfaces

When you restart your networking will be back to normal.

I know this is very long, but it is actually very simple, I just have a long explanation. In short, set the networking for eth0 up and then get the other computer set up.

About Jack Woods

I'm a teacher, writer, traveler, and designer. I'm into alternative medicine and I like designing programs and devices to make life easier.
This entry was posted in Ubuntu and tagged , , , . Bookmark the permalink.

3 Responses to Sharing Internet Connection with a Crossover Cable

  1. Patrese says:

    thanks for the tutorial.

    it works but not completly.

    i can ping the windows pc but it can not access the internet.

    can you help me?

    thank you again!!!!

  2. jeu says:

    I think this is working in my pc completely.
    I am currently sharing my internet with crossover cable.
    And it works fine for me.

  3. Thomas says:

    hey i need a little bit of help.
    I dont know exactly what this tutoriall is doing for sure.
    I am trying to figure out this:
    my lappy has wifi and i want to use the crossover cable to branch the internet connection to my desktop.
    Can you please help me?
    thanks in advance :D

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>