Tag/tag.png

Unsupported Version
This article applies to an unsupported version of Ubuntu. More info...

Tag/tag.png

Style Cleanup Required
This article does not follow the style standards in the Wiki Guide. More info...

How to use your laptop as an internet access point for a desktop

This was originally posted on the ubuntuforums in this thread.

The intent of this how to is to use a crossover cable and a wireless laptop to connect to the internet from a desktop computer that is too far from the router to run a cable.

By the way, there are a lot of words here, but that is because I like to be complete, not because this is hard. Read the whole thing before you start and you will discover this isn't especially technical or difficult.

Notes:

  • I am running Ubuntu 5.10 (Breezy Badger) on both the laptop and desktop.
  • My laptop is an AOpen 1557gls, configuration listed here in the entry I made on the Ubuntu Wiki.

  • My desktop is made up of a bunch of old parts including an AMD Duron processor. It is nothing special except it has a working ethernet card that I pretested by plugging it directly into my router.
  • My router is a Linksys WRT54G with the latest official firmware. This will likely work with other hardware and setups, but I have only tested it with mine. I am using WPA, but since all that is needed here is a working wireless connection that is beyond the scope of this howto. I connect from the router to the high-speed modem using DHCP.

Before you start

Make sure you have a working connection from your wireless laptop to your router and from there to the internet.

Make sure you know how to use and set up your router as well as how to find it's configuration. For me this is through a browser interface at 192.168.1.1 when connected directly to the router via an ethernet cable or wireless connection.

Find the following information from your router's configuration. I will list mine (where security permits) for comparison and so you can see it below as we continue. On the linksys wrt54g with firmware version 4.20.7 this is found under Status->Router in the configuration pages.

IP address: 192.168.15.100
Default gateway: 192.168.15.1
Subnet mask: 255.255.255.0
Domain name: your.netprovider.net
DNS: xxx.xxx.xxx.xxx (there will likely be 2 or 3 assigned to you by your internet provider and DHCP)
  • for me to log into my router from any computer on the network the address is 192.168.1.1
  • the router assigns addresses to computers using it from 192.168.1.100 to 192.168.1.149

Things you will need

  • A desktop computer with a working Ubuntu installation and a tested and known to work ethernet card. (I will call this desktop)
  • A ethernet crossover cable...NOT a regular ethernet cable
  • A wireless access point that is already configured properly and has access to the internet (I will call this router)
  • A laptop or other computer with a working Ubuntu installation and a wireless connection that is configured properly and already works (I will call this laptop)

Step 0: Plug in the cable

Plug the crossover cable in to the ethernet ports on the desktop and the laptop. Make sure both computers are turned on before you continue. It will be easiest if the computers are right next to each other for this process.

Step 1: Install Firestarter on the laptop to configure access

  • Install Firestarter on your laptop, either using synaptic or apt-get install firestarter

  • Configure Firestarter:

Preferences->Network Settings

  • select the laptop's wireless card (for me eth1) as your "Internet Connected Network Device"
  • select the laptop's ethernet card (for me eth0) as your "Local Network Connected Device"
  • select "Enable internet connection sharing"

Step 2: Configuring your network rules on the laptop

From the panel menu: System->Administration->Networking

Your wireless connection (for me eth1) should already be configured properly and working so I won't discuss that here. Your settings for that card/connection will not change at all.

Highlight your Ethernet Connection (for me eth0) and select "Properties"

Check "This device is configured"

Configuration: Static IP address
IP Address: 192.168.2.102 *see note just below
Subnet mask: 255.255.255.0
Gateway address: 192.168.15.100 +see note just below

Choose your wireless connection as the "Default gateway device"

Click "ok" because you are done here.

*the important thing here is to choose a different subnet from what your router assigns to computers connected to it. Mine assigns addresses in the 192.168.1.xxx subnet so I chose to use here 192.168.2.xxx

+This is from the Default Gateway listed in the router's setup page as shown above.

Step 3: Configuring your network rules on the desktop

From the panel menu: System->Administration->Networking

Highlight your Ethernet Connection and select "Properties"

Check "This device is configured"

Configuration: Static IP address
IP Address: 192.168.2.103 *see note just below
Subnet mask: 255.255.255.0
Gateway address: 192.168.2.102 +see note just below

Choose your wireless connection as the "Default gateway device"

Click "ok" because you are done here.

*the important thing here is to choose the same subnet as your laptop is using. Earlier we used 192.168.2.102 subnet so I chose to use here 192.168.2.103. Same subnet, different computer.

+This has to be the same as the IP address for your laptop's ethernet connection (eth0).

Step 4: Configuring the Domain Name and servers properly

This step insures that your desktop will have access to the internet the same way the laptop does and be able to use names for web sites and not just IP addresses...in other words, we are going to tell your desktop the some of the same information manually that your router is telling your laptop through DHCP.

On your laptop, open the file /etc/resolv.conf In it you will find something like this:

search your.netprovider.net
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

Keep this information handy.

Go to the desktop and put the exact information in the file /etc/resolv.conf on the desktop using your favorite editor.

gksudo gedit /etc/resolv.conf

It is probable that this file is currently blank. In any case, completely erase the contents if there are any and type in exactly what is shown in the same file on your laptop then save.

Okay. Time to test. Open firefox and type something simple in the address bar like "www.google.com"

If we did everything right it will work, but we are not quite done.

The resolv.conf file will be regenerated on the desktop every time you reboot. Unless you enjoy recreating the file each time, there is one more step remaining.

While the current internet connection is working on the desktop computer, with all the extra repositories enabled, fire up synaptic or apt-get install resolvconf on the desktop computer

Once that is installed

sudo cp /etc/network/interfaces /etc/network/interfaces_backup

gksudo gedit /etc/network/interfaces

and add the following to that file under the heading shown using the information from your current, working /etc/resolv.conf:

iface eth0 inet static
dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
dns-search your.netprovider.net

This will automatically create your (correct) /etc/resolv.conf file every time you reboot.

Afterword

Please correct any mistakes you find. I don't know how adept I can be at answering questions and such as I just learned this myself, but I figured someone out there probably wants to do the same thing. It is also conceivable that we may want to modify this to have an even wider applicability.

  • originally written by Matthew5. Permission is granted to use, modify, or post this information wherever and however you like. That includes giving the page a better title if you think of one...please just let me know.


CategoryHardware CategoryNetworking CategoryWireless

WifiDocs/WirelessLaptopInternetAccessPoint (last edited 2011-06-04 23:57:25 by r74-192-224-245)