Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I'm trying to get an internet connection from my laptop via my SGS2. The phone is rooted, and I've tried two different WiFi tethering apps. I don't have a tethering plan (they want to charge me more than my home broadband!) so that's why I'm not using the native tether.

When my laptop connects to the WiFi hotspot, it fails to get an IP address. I guess this is due to the phone not running a DHCP server. I've tried the following:

  • Setting the IP of the interface to 192.168.1.99 and 10.0.0.99 (in case of standard /24 and /8 ranges) with x.x.x.1 as the default gateway.
  • The same as above, except with the public 3G internet-facing IP as the default gateway.
  • Setting the IP of the interface to the phone's public 3G internet-facing IP.

I've been unable to send ICMP pings to any IP address. I've also tried setting various DNS servers (private IPs, 8.8.8.8, etc.) but can't resolve any host names. It's like the traffic just gets black-holed at the phone.

Any ideas? I'd be happy to go with a USB tether, but my plan doesn't cover that and I've yet to find an app that'll allow me to get round it.

share|improve this question
    
With the hotspot enabled, have you checked what IP it is using -- or have you simply guessed the 192.168.1.99 and 10.0.0.99 addresses? OS Monitor is one of the apps showing you all interfaces and their current settings, when in doubt. –  Izzy Apr 22 '13 at 22:18
    
I guessed the 192.168.1.0/24 and 10.0.0.0/8 ranges, and you were 100% right - I got them wrong. Don't know why I never considered running ifconfig wlan0 on the device - it was running on 192.168.43.0/24. A little annoying that the app didn't tell me which IP to use though... –  Polynomial Apr 22 '13 at 22:34
    
LOL Yeah, I didn't want to suggest that -- though I should have guessed you are familiar with the command line :) So did that solve your issue, so I should make it an answer for others to find? (And btw: I find it very annoying that it cannot be configured. I'd like to fix it to a given network, so I've not to pray it won't switch the next time...) –  Izzy Apr 22 '13 at 22:36
    
@Izzy Yup, solved it. Add an answer and I'll accept it. And I absolutely agree that it should be configurable. FoxFi seems rather limited in that regard, but at least it works. I believe that Barnacle does allow for such configuration, but it doesn't seem to work on my device due to problems starting the driver. –  Polynomial Apr 22 '13 at 22:42
    
Glad I was able to help - and thanks for the upvote :) –  Izzy Apr 22 '13 at 22:59
add comment

1 Answer

up vote 1 down vote accepted

You should first check which IP address (and network) your hotspot is using. From the (e.g. using a app like Android Terminal Emulator or adb shell) you can figure this out with the command

ifconfig wlan0

If you rather want to avoid the command line, or your device uses womething other than wlan0 for the interface and you want to avoid guessing, OS Monitor is an app which tells you all the necessary details for each interface as well.

Once you've found out the correct data, you can specify those on your laptop: Use the IP of the interface for the gateway, and take network and mask accordingly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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