Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have been trying to share my wired Internet connection with my Android phone. However I could not succeed in doing this. Has anyone of you ever succeeded? Operating systems that I use are as follows:

  • Ubuntu 10.10
  • Android 2.3
share|improve this question
    
I have been trying to find a solution for some time to this, and have tried a number of things, without success. I think the best option would be to create a wireless network on Ubuntu that is NOT an Adhoc wifi network (because Android does not detect such connections). There are instructions on how to do this out there, but I find them either too complicated, or they just don't work. So a step-by-step walk-through on how to do this would be welcome. –  geoffrey Oct 23 '11 at 2:14
    
It is likely that you'll have to specify the network name on your Android device. –  Jo-Erlend Schinstad Oct 25 '11 at 16:59
    
Still no satisfactory answer after the bounty period, so I suppose the answer to this question is: it's really difficult! I have awarded the bounty to the most 'voted up' answer, a helpful answer even if not the solution I was looking for. –  geoffrey Oct 30 '11 at 1:22
    
@Jo-ErlendSchinstad Thanks, I tried this but it does not help. –  geoffrey Oct 30 '11 at 1:23

8 Answers 8

Yes, it is possible. I have Ubuntu 11.04, NetworkManager 0.8.4, Android Nexus One phone running Cyanogenmod 7.

As described by Roman, right-click on the NetworkManager icon and choose "Create new wireless network". I chose to leave the connection wide open (no WPA, no WEP). My phone was able to see the network right away and I connected without trouble. The bridging was automatically done so I could browse the internet without configuring anything extra.

The reason why you having trouble with the above method is because stock Android 2.3 doesn't support ad-hoc networks. To be precise, Android's wpa_supplicant does not show ad-hoc networks. There are a number of ways to fix this. Google around and go hunting in the xda-developers forums. You will probably need to do some hacking on your phone that is beyond the scope of this answer.

My personal recommendation: if your phone supports Cyanogenmod, you can install it to get ad-hoc support and other hackish delights. You will need to root your phone, which may or may not be to your taste.

Another alternative is to try "Infrastructure mode". After setting up the ad-hoc wireless network as per above, click on the NetworkManager icon, choose "Edit connections". Hit the wireless tab and Edit the ad-hoc network you just created. Under Mode, choose "Infrastructure". I am unsure if this will work for you since I don't have a stock Android phone to test with. My thought is if ad-hoc mode is the problem, then the another mode might be the solution.

Good luck!

share|improve this answer
    
Thanks! Well, I understand that rooting a Wildfire S is not that simple, so that won't work for me. The 'infrastructure mode' sounds interesting, but so far I was not able to get it to work - it just won't connect. I'll try googling around for solutions to that problem ... –  geoffrey Oct 26 '11 at 1:27

Please check out this link and tell me if it's roughly what you're looking for.
https://help.ubuntu.com/community/WifiDocs/WirelessAccessPoint

If it looks like it is (or is close to) what you're looking for let me know.
I'm interested in doing this myself, only with the slight modification of directing traffic through ppp0. Which is a tethered connection.
Perhaps we can tweak these instructions to do what we need.

Edit: This looks as if it would work best on a dedicated machine (essentially making it a router). I'm still looking through the configurations, but this might cause some problems for a laptop that you would use the wireless to connect to various locations.
Also, there appear to be a couple of steps involving a Windows machine we maybe able to forgo.

You'll also want to see this. https://help.ubuntu.com/community/WifiDocs/MasterMode

share|improve this answer
    
Also, I tried setting up the wireless through Network Manager (as suggested by RocketScientist) without any real success. That doesn't mean it can't work just that it didn't for me. There maybe another variable I didn't have that he does. bridge-utils for example. –  Argusvision Oct 27 '11 at 19:27
    
thanks, that sounds interesting (though rather complicated). Unfortunately I don't have time to look into it before Sunday, but please report any success with this. –  geoffrey Oct 27 '11 at 23:20
    
I'm hoping I'll get a chance to play with it. Any chance you can extend the bounty to Monday morning so I can work it this weekend? –  Argusvision Oct 28 '11 at 1:14
    
sorry, but I don't think I have the power to extend the bounty ... –  geoffrey Oct 28 '11 at 23:28
    
... but there is a 'grace' period of 24 hours after the end of the bounty, so that gives you another day –  geoffrey Oct 28 '11 at 23:47

First of all as we all know stock ROM of Android i.e. the one which comes with the phone does not support ad-hoc mode (surprisingly), and even Ice-Cream Sandwich (Android 4.0) won't support ad-hoc mode.

So, we need to create an access point using Ubuntu to which any android phone can easily connect. In Windows you can use Connectify to do that and it works perfectly well but with Ubuntu you may have certain problems, depending on whether your wifi-card supports access point mode (master mode) or not.

Now, even if your wifi-card supports access point mode, the next problem is whether the driver of your wifi-card supports AP mode or not, if it does then the problem is solved and if does not then you have three options:

  1. Wait till the driver receives an update for AP mode. (many wifi-card drivers are still in staging stage)

  2. Buy a wifi-dongle and make sure it supports AP mode on ubuntu.

  3. Use Windows, where Connectify will do the job for you.

If you are interested you can post the name of your wifi-card driver so that I can help you further. Use this command:

lshw -c network
share|improve this answer
    
A working solution, follow this link: superuser.com/questions/407371/… –  adnan kamili May 10 '12 at 2:24

I found a working solution to share my Internet connection with my phone via USB reverse tethering, but my laptop uses a wireless connection for it:

Internet -> Wireless -> Laptop -> USB cable -> Android phone

So if that would be possible for you, or if you have a second ethernet card for your pc, you should check out the 'Reverse Tether Trial' app from the play store.

  1. Connect your pc with the Internet as usual
  2. Connect your Android phone via USB to your pc
  3. Activate 'USB-Tethering' in Androids 'Settings'
  4. Create a new wired connection in Ubuntus network manager as described here
  5. Start Reverse Tether and follow it's instructions
  6. Browse on your phone :)
share|improve this answer

Assuming you also have a wireless card in your computer: In Network Manager, click the menu and 'Create New Wireless Network...'. Later, you would be to see the network in your Android.

share|improve this answer

You can create a wireless network from your computers wifi menu. Right click on the wifi icon in the taskbar and click create new network. Fill out the options then connect to it from your phone. Make sure your computer is also connected to the wired network cable. The cable should be automatically bridged to the wireless from my understanding, and it should all work fine.

share|improve this answer
    
Thanks for the reply. After I created a new wireless network, i cannot see this network on my phone. What did I do wrong? –  Erdem Oct 16 '11 at 20:25
    
Thats very strange. Are you sure your computer has a wifi card? –  Roman Oct 17 '11 at 22:02
2  
Android does not detect the 'adhoc' type of wireless network created by network-manager, so this will not work. –  geoffrey Oct 19 '11 at 7:16

I tether with Android via USB tethering. You can also use Ubuntu's "broadband connection" feature that's in the nm-applet as well, but it's slower.

share|improve this answer
    
Thanks for your answer. The question is about getting internet on an Android phone, when the phone cannot connect either via 3G or wifi, and when a computer has a wired internet connection. I think your solution addresses the opposite situation: phone has internet, computer does not (but if I have misunderstood, could you please be more explicit?). –  geoffrey Oct 24 '11 at 11:59
    
I'm sorry, I did answer for the reverse. I doubt Android supports that kind of functionality to be honest, but I haven't researched this. –  Vadi Oct 24 '11 at 21:44

This works for me

  • Ubuntu 12.04
  • Android 4.0.4

Install hostapd

sudo apt-get install hostapd

In simple words, hostapd allows you to create software wifi access points allowing decent amount of configuration options. In rest of this post, I will show how to create a software access point in Linux using hostapd and share your internet to the devices through it

After installing hostapd install dhcp server

sudo apt-get install dhcp3-server hostapd

Then, open a text editor program, for example gedit Copy the following into it.

interface=wlan0
driver=nl80211
ssid=YOUR_SSID_NAME
hw_mode=g
channel=11
wpa=1
wpa_passphrase=YOUR_PASSWORD
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_ptk_rekey=600

Please change to fill in the name of your network after ssid=, as well as the password after wpa_passphrase=.

save the file as hostapd.conf in your home folder

Create a new ad-hoc wireless and connect it.

Now, Open terminal and type:

sudo hostapd hostapd.conf

Turn on your phone wifi and find your ssid.

Source from HERE

share|improve this answer
    
This gets me way closer but the phone is stuck trying to get an ip address. –  DavidG Nov 28 '13 at 17:52

protected by jokerdino Nov 28 '13 at 16:40

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.