Set up Ubuntu 12.04 Laptop as WiFi Hotspot (ad-hoc) to Share Wired Internet

The post has been moved to, sorry for the inconvenience.


      1. I know its a bit late now bui by using a static IP, and manually configuring the gateway and DNS you can easily connect your Android phone.

          1. FIrst of all, android by default doesn’t support an ad-hoc network I use a rooted Galaxy S2 with edited build.prop files, and there are also other custom ROM’s that enable ad-hoc support,

            For those who don’t have root you will have to do a lil more work to connect, first of all your computer’s wifi must support infrastructure mode(most devices now do) and then it is an execution of series of commands but somebody made up a script called AP-Hotspot which if anybody searches will get instructions to install and configure, or alternatively there is Wiconnect which offers a GUI, which will enable setting up a hotspot and for some people there will be an issue of the android device getting stuck at “Obtaining IP address”, in that case setting a static IP through the advanced wifi settings will help you connect it immediately, for example after setting up the hotspot, find your computes default gateway address which will be something like “” (Note:this is an example it could be different for you) or finding your computers IP something like “” and then replacing the 4 with 1 will also usually work, this address ie. “” should be the gateway address typed in your android device for static IP you can give any number at the end like “”, just make sure no other device uses the same IP, netmask should be the usual “ and both the DNS server’s should be Google DNS ie, “ and” and thats it, works everytime.

  1. Thank you for this! This advice is the only thing that has worked to get my iphone4 to connect to my ad hoc wireless laptop connection.

    The key point was that the password must be five characters long. How bizarre!

  2. Your directions say:
    “First of all, what you need are:

    The laptop is connected with internet via wired connection (WLAN)”

    My laptop (actually, my netbook) works also with a 3G USB modem, and since my Android/Linux phone lacks 3G capability — I would like to feed this signal to my phone.

    This way I could have Internet connectivity, when the phone is being used without a nearby Wi-Fi connection.

    Question: please tell me, is your method strictly limited to use with a wired connection? Or, if there some modification to do the same, but by getting the Internet connection from an USB 3G modem, instead?

  3. So sorry, I did not see the section ‘Older Comments’ before posting. Back in May another user wanted to do this and you said as far as you know it is not possible.

    I was only able to read the English-language comments so is it possible the other exchanges contain what I need?

    I am hoping since May, there could be be new information? But if not, I shall continue my search.

    1. @RonC: So far, I have not heard guys succeed to use USB modem to build an ad-hoc hotspot. You can do a google search, and I would like to know how you fix the problem. Good luck.

  4. Hi. Thanks for your tutorial.
    My hotspot works with my ipad but only if I don’t set any password. If I use the 5 characters one, the ipad asks for a username and the password but cannot connect (I used no username and the username on the pc but nothing …).


    1. @Tomi: Thanks for your information. The post here was just my successful experience. Considering the complex of the mobile devices, I think it really depends on your fortune.

  5. all are fine but net…but a msg comes “hotspot is not connected to internet…Do you want to join anyway???”
    but i’m sure i was conneted to internet

  6. I followed the instructions to the dot, I also got the message “hotspot is not connected to internet…Do you want to join anyway???” but I just connected to the ad hoc hotspot anyway. Then voila! I can now browse the internet thru my iPad. Thanks.

  7. hello Sir,
    Still i have a problem in connecting my Android Phone Samasung Galaxy S DUOS with my wireless connection.
    m using UBUNTU 12.04 version, i followed all the steps given in above tutorial but still facing to fix it.
    m using a wierd network…
    pleasse help me out

    1. For Android devices to use Ubuntu WiFi, can you try it below? and tell me the result, OK?

      sudo add-apt-repository ppa:nilarimogard/webupd8
      sudo apt-get update
      sudo apt-get install ap-hotspot
      sudo ap-hotspot configure
      sudo ap-hotspot start


您的电子邮箱地址不会被公开。 必填项已用*标注