Getting iPhone Internet Tethering Working in Linux

I’ve owned couple of mobile phones now, all in increasing number of features. But the one thing that remained common amongst all of them, was the ability to use a tethered Internet connection in both Windows and Linux. Until I got the iPhone, that is. With the iPhone, I could no longer use the iPhone as a modem in Linux. Not anymore.

I was recently researching about claims that Ubuntu could sync with the iPhone, even the non-jailbroken ones. I was a little skeptical about this. What I found was libimobiledevice, and the iPhone Ethernet driver for Linux. I’ll write on libimobiledevice at a later day.

Let’s have a look at the USB Ethernet driver: The iPhone USB Ethernet driver was written by Diego Giagio, and is a kernel driver which adds support for iPhone tethering through USB cables. Like libimobiledevice, the driver doesn’t require you to jailbreak your iPhone, so bonus marks here.

Let’s start on how we can achieve this. This post is written from a Ubuntu/Debian system perspective, if you’re using some other distribution, the steps should remain same, with the exception of getting the packages via your favourite package manager.

First: Get the source from Diego’s git repository. If you don’t have git installed, open the terminal and type:

sudo apt-get install git-core

Once git is installed, get the source for the drivers

git clone git://github.com/dgiagio/ipheth.git

The output should be something like

sathya@shaman:~$ git clone git://github.com/dgiagio/ipheth.git
Initialized empty Git repository in /home/shaman/ipheth/.git/
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (10/10), 8.11 KiB, done.
sathya@shaman:~$

Now, compile the pairing program.

cd ipheth/ipheth-pair

make

You should get an output like:

sathya@shaman:~/ipheth/ipheth-pair$ make
gcc -Wall -O2 ipheth-pair.c -o ipheth-pair -liphone

Next, type:

sudo make install

You should get an output like:

sathya@shaman:~/ipheth/ipheth-pair$ sudo make install
install -m 0755 ipheth-pair /lib/udev/
install -m 0644 90-iphone-tether.rules /etc/udev/rules.d
/sbin/udevadm control –reload-rules
sathya@shaman:~/ipheth/ipheth-pair$

Compile the Kernel driver:

cd ipheth/ipheth-driver

make

You should get an output like:

sathya@shaman:~$ cd ipheth/ipheth-driver
sathya@shaman:~/ipheth/ipheth-driver$ make
make -C /lib/modules/2.6.28-15-generic/build M=/home/sathya/ipheth/ipheth-driver modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-15-generic’
CC [M] /home/sathya/ipheth/ipheth-driver/ipheth.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/sathya/ipheth/ipheth-driver/ipheth.mod.o
LD [M] /home/sathya/ipheth/ipheth-driver/ipheth.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-15-generic’
sathya@shaman:~/ipheth/ipheth-driver$

The kernel module is ready. Now load the module.

sudo insmod ipheth.ko

We’re all set to try the new driver out. Now connect the iPhone. The iPhone should get detected, as shown in the picture.

To confirm that the USB Ethernet driver is in use, open the terminal and type

dmesg | grep iPhone

You should get an output like:

sathya@shaman:~/ipheth/ipheth-driver$ dmesg | grep iPhone
[22871.808469] ipheth 2-2:4.2: Apple iPhone USB Ethernet device attached

Yay! That means the USB Ethernet driver is ready. Lets switch on Tethering on the iPhone.
Switch on iPhone tethering

Lets see what happens. Prior to installing the driver, I would get no notification and nothing would happen. Not now.

To confirm that we have indeed connected using iPhone let’s have a look at Network Manager connections:

iPhone tethering done

And there you go, iPhone tethering on Linux!

Notes:
1: You _need_ to have tethering working. From what I know, tethering is not officially allowed under AT&T’s plan, so I don’t think this method will work.
2: I was unable to compile the pairing program. I’m not sure why the compilation failed. Despite this, the Kernel driver works work. I assume that the pairing program is required if you need Bluetooth tethering.
3: I tested this on my iPhone 3G running on iPhone OS 3.1.2. Although mine is a jailbroken iPhone, the author mentions that jailbreaking is not required.

Share:
Comment on This Post |
Tweet This |
Share on Facebook |
Save to Delicious |
Stumble This |
Digg This |
Reddit This

TAGS: , ,

Announcement: Missing Mobile News in the Main RSS Feed? We have decided to remove the mobile content from the main feed, please subscribe to our dedicated Mobile News RSS Feed at http://feeds.techie-buzz.com/techiemobile. Thank you for your understanding.

Getting iPhone Internet Tethering Working in Linux originally appeared on Techie Buzz written by Sathya Bhat on Sunday 11th April 2010 01:55:48 PM. Please read the Terms of Use for fair usage guidance.

Don’t miss these Related Posts:

Join Techie Buzz on Your Favorite Social Networking Sites