Everyone knows what tethering is: using your mobile phone’s data plan to get Internet on your laptop. Well, here’s the concept of reverse tethering: you don’t have a mobile data plan or a WiFi connection available for your smartphone, but you have a WiFi connection available for your laptop. Therefore, you want to use your laptop’s WiFi internet connection to get internet on your Android phone.
When might this be useful ? you might ask. Well, here I am in a hotel room where my phone can’t connect to wifi (either a CyanogenMod fault or a phone hardware problem). I can’t use the WiFi Internet sharing included in Mac OS X, because the WiFi is already used for Internet. On Windows/Linux, it’s quite easy to do. What about Mac OS X ?
Well, it seems Android’s reverse tethering is based on a Microsoft protocol (ha-ha, the irony). Although it’s specifications are public, it’s not implemented in Mac OS X at all and probably will never be. You could try AJZaurusUSB, which makes your USB device appear as a network interface to Mac OS X. It’s easy then to use Mac OS X’s Internet Sharing to give Internet access to the device connected on USB.
For me, AJZaurusUSB didn’t work unfortunately. It installed successfully, but no new network interface appeared. What to do, what to do ? Hmm. We have Bluetooth, don’t we ? Go to Mac OS X’s System Panel, Network, add a new network interface (“+” button in bottom left), choose “Bluetooth PAN” and set up your Android phone. Get the wizard done and press “Connect”. You’ll get a new “Bluetooth PAN” network interface in the left list (it was en2 on my laptop, with en0 being Ethernet and en1 being the Wifi interface).
Now, go back to system panel and into Sharing. Go to Internet Sharing and “Share your connection from Airport” “To computers using: Bluetooth PAN”. I assume this is the equivalent of masquerading, which could be also achieved on Linux with:
iptables -A FORWARD -i tap0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A POSTROUTING -t nat -o tap0 -j MASQUERADE
iptables -A INPUT -i usb0 -j ACCEPT
iptables -A FORWARD -i usb0 -o tap0 -j ACCEPT
And that’s it ! browser will work, email will work, maps will work… except Market 🙁 it seems Android applications which access the network are relying on ConnectivityService to find out if there’s a network connection available. Our method doesn’t make ConnectivityService think we’re online. You can read more about ConnectivityService not being notified here, unfortunately there seems to be no other solution other than recompiling it. Bummer.
Seems to be quite an omission from Google, considering even the old Windows Mobile was able to do this. However, in this world of “always connected/wifi everywhere” (except here :-D) probably nobody will bother to fix this. It seems HTC offered an “Internet passthrough” mode for the new devices, but it’s Windows only and requires HTC Sync to be installed.
Rooted Samsung captivate with cyanogenmod 7 and Mac mini osx lion. They are connected on BT pan, BT internet sharing on, but no connection on phone. Help?
Have you managed to get ConnectivityService reporting to be online ?