How To Share Your Internet Connection

By | 2009/06/13

Recently I asked for some user-contributed content for the site, and while I didn’t get the amount of feedback that I’d like, I did get one good suggestion that I knew I needed to pass on. How to share your internet connection. This tutorial outlines, in a very simple way, how to share your wired connection by creating an ad-hoc wireless broadcast. I imagine this would be great for LUG meetings and small gatherings where wireless is lacking but there is limited wired connectivity. Thanks to Aaron for the suggestion.

Requirements

In order to share your wired connection and create an ad-hoc wireless network you will need the following:

  • An active wired network connection
  • Functional wireless network device
  • Network Manager 0.7 or later
  • dnsmasq-base package installed

Installation and Configuration

The requirements above are pretty easy to come by. Network Manager 0.7 or later should be installed by default on any Ubuntu version past 8.10 (Intrepid, Jaunty and later). The dnsmasq-base package can be installed using the command (or clicking the link):

sudo aptitude install dnsmasq-base

At this point you should have all of your requirements met and we can move on to creating the ad-hoc wireless network.

Click on the Network Manager icon and select “Create New Wireless Network”.

You’ll be prompted to define a Network Name and optional Wireless Security Level. Once you define these values and activate you should be able to see a new SSID listed and begin sharing your connection. Enjoy!

19 thoughts on “How To Share Your Internet Connection

  1. jonathan

    Nice, i think dnsmasq-base should installed by default.

  2. marc

    Don't you need some sort of wireless networking hardware for this? *confused*

  3. zelut Post author

    I suppose the wireless hardware was assumed, but I'll add it to the list for clarification.

  4. Johan

    It may also be worth mentioning that there are wireless drivers for which this doesn't work (the proprietary broadcom driver being one of those).

  5. Lorenz

    Can one also share a wireless connection? perhaps a stupid question, because if there is already one…but still, just out of interest.

  6. dnpate

    Can the opposite be done with the internet connection wireless and the sharing wired?
    TX
    David

  7. Aaron

    you should be able to share an already existing wireless connection, but I believe you would need another wireless device on your computer.

    An example where this would be helpful is using your computer as a wireless repeater. ie you have a computer that is on the edge of signal you could catch the signal then spit it out again with another wireless card.

    thanks for the shout out to my blog

  8. Jake

    @Aaron: I can't figure out how you can use Network Manager to set up the machine to act as a repeater. The reason for my confusion is that it does not appear as though Network Manager allows you to configure a wireless profile specific to a particular NIC, and you would need to have two distinct profiles for each NIC (one profile/NIC to connect to a particular access point, one profile/NIC to re-broadcast the connection). Perhaps I'm missing something though. Please let me know what you think.

    FYI, I also posted this question on Ubuntu Forums: http://ubuntuforums.org/showthread.php?p=7474986#

    Thanks,

    Jake

  9. Jake

    Ah, nevermind, I see now that you can actually select the NIC on which you want to create the network.

  10. Jake

    I currently have this setup almost working perfectly. I have the connection shared between my two NIC's. The only problem is that DNS masquerade does not seem to be working correctly, as I can connect to my repeater and navigate to http://72.14.205.104/ in Firefox, but the same thing does not work when I attempt to navigate to http://www.google.com. To confirm this, I edited /etc/resolv.conf and set the contents to be the same as the resolv.conf file on my repeater. After that, all hostnames resolved correctly on the computer behind the repeater. This is all on Ubuntu 9.04. Could anyone tell me what I need to do to troubleshoot this?

    Thanks,

    Jake

  11. popon

    The wsame questions as ALWAYS:

    How do we know if we have the Network Manager installed and if its version 0.7?

    How do we stop the wifi server?

    How do we restart it?

    How do we know if it's on?

    Boot info?

    How do we install it as a daemon?, etc….

    How do we decide what optional Wireless Security Level???

    you should be able to see a new SSID…where? Me or they?

    Enjoy!

  12. Aaron

    How do we know if we have the Network Manager installed and if its version 0.7?
    right click on the network manager in the system tray and click about, this will have the version displayed

    How do we stop the wifi server?
    you can disable the network card, or connect to a available wireless network. The only time your shared connection will be available is when you tell it to connect or if there are no other wireless connections available or that you have previously configured.

    How do we restart it?
    disable the network card and then re-enable it. I dont know if there is another way to restart this or not.

    How do we know if it's on?
    The wireless network manager will tell you that you are connected to your wireless network you created.

    Boot info?
    network manager boots automatically and like I stated before, it will automatically connect to it if there are no other preferred networks. If you make the wireless network you created the only preferred network than it will always start it up first.

    How do we install it as a daemon?, etc….
    dont know, but stated above describes how it starts automatically

    How do we decide what optional Wireless Security Level???
    if you have older computers or older OS's then its better to use an older level of security, imo. If possible use the newest security available. WPA v1 is probably the most common these days.

    you should be able to see a new SSID…where? Me or they?
    It will say you are connected to the wireless you created, They will be able to see your new wireless network

    I hoped this helped, sorry to Jake for not responding in a timely fashion, summer school has kept me in a constant state of cramming.
    Aaron

  13. Johan

    Thank you. I have followed your directions and I can see the shared internet connection in the list of available wireless networks from another client. But when I am trying to connect, it fails. And I cannot find any useful logs on what goes wrong. I have tried using a Ubuntu client as well as a Vista client. The network is there, but I fail to connect. On the server, I keep getting error messages saying wlan0: No active IBSS STAs – trying to scan for other IBSS networks with same SSID. There are twice such messages each minute. Any ideas?

  14. cutiyar

    i want share my usb modeum internet , how to do it?

  15. Jean Jordaan

    I created a new wireless network.

    Subsequently I can’t connect to any existing wireless network — the notification icon just spins. Did I somehow bork the mode of the wifi device?

    This is on Ubuntu 10.10 with NetworkManager 0.8.1

  16. hyunjungsoh

    Hello, I was able to create a wireless network in Ubuntu, my other machine (windows XP) can connect to the network but then it cannot browse the internet… why?

  17. MannerPanner

    Can you share a dial-up connection with a wireless router though an Ethernet card?

Comments are closed.