Tether Your iPhone in Linux

About a week ago, maybe two, instructions were posted on the net to tether your iphone’s EDGE connection — allowing you to make full use of your unlimited data plan via your laptop. A notably missing feature in the iPhone, as every other EDGE enabled device I’ve ever owned allows you to do this with ease.

The instructions were posted for Windows and Mac though, and while I love my Mac, my laptop runs RHEL 5… as such, here’s the instructions to tether your iphone’s EDGE to your linux box.

Assumptions:

  1. You have a jailbroken iphone.
    1. How to escape jail using iPHUC
    2. Instructions for installing dropbear *optional*
  2. You’re comfortable with Linux, and have wireless-tools installed in your distro

 

The Process…

First, download the iPhone Tether Kit. DO NOT run the scripts in this zip. Copy the srelay binary to /usr/bin on your phone, and net.sourceforge.socks-relay.srelay.plist into /System/Library/LaunchDaemons on your phone… you can accomplish this using scp if you installed ssh, otherwise, use iPHUC.

NOTE: if you copied the files using iPHUC, you’ll need to set the executable bit on /bin/srelay using chmod. This sounds easy, but it’s a process documented elsewhere (see the installing ssh instructions).

Reboot your iPhone, and you’ll have an open socks relay server!

That’s the easy part, and this next one’s even easier…

Open up a command line terminal, and identify your wireless adapter using iwconfig. Mine’s eth1, so we’ll do the following:

ifconfig eth1 down
iwconfig eth1 mode ad-hoc
iwconfig eth1 essid "My AdHoc Network"
ifconfig eth1 up
ifconfig eth1 10.3.3.1

This sets up an adhoc wireless network with ESSID “My AdHoc Network”. Pretty simple.

All you need to do now is connect your iPhone to it. In Settings->Wi-Fi, select “My AdHoc Network” from the list, and edit it’s settings. Press “STATIC” to set a static IP with no router… I entered “10.3.3.2″ for my IP and “255.255.255.0″ for my subnet mask, and left the other values blank.

This will connect your iPhone to your adhoc network, and the Phone will use EDGE for its data connection. Now all you need to do is tell your client apps on your laptop to use the SOCKS proxy at 10.3.3.2:1080, and voila! You’re accessing the internet via iPhone’s EDGE connection on your laptop.

Many thanks to:

  1. NerveGAS
  2. NightWatch
  3. Everyone at #iphone

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>