Home > Uncategorized > iPhone tethering with Ubuntu

iPhone tethering with Ubuntu

Today was my first time I used iPhone tethering. Tethering means connecting computer to the internet using iPhone’s cellular connectivity (3G/EDGE). The iPhone connects to the computer via USB cable or Bluetooth and uses as a cellular modem. It’s useful when you’re away with a laptop and no wireless hot spots around.

There are many tutorials out there, however I found most of them misleading (advising to use third party software or jailbreak your iPhone – both unnecessary) and none of them for Linux. This tutorial is really easy and simple.

Step 1 – Enable internet sharing on your iPhone
On your iPhone goto Settings -> General -> Network -> Internet sharing -> On. If “Internet sharing” isn’t shown, open Safari and browse to: http://help.benm.at. On this webpage click on “Tethering”, then select your country and your mobile carrier. Accept the profile and reboot your iPhone. After the reboot “Internet sharing” option is supposed to be shown. In my case, my carrier wasn’t on the list so I generated a custom file (the last option). The APN/User/Password were easily found using Google. However, “Internet sharing” stayed hidden. The funny thing is after I removed the custom profile it magically appeared. My iPhone version is 3.1.2 and it worked. I noticed they have warning for 3.1.3 so watch out if you got it.

Step 2 – Install necessary software on Ubuntu
As always, I provide instructions for Ubuntu. The driver you need is called “ipheth” and it depends on “libimobiledevice”. Now, you can find them both on Lucid’s official repositories. However, only version 0.9.7 of libimobiledevice is there, and while it may be enough for tethering, I recommend using the newer version which can be obtained from Paul McEnery PPA (for Karmic it’s still version 0.9.7):

# sudo add-apt-repository ppa:pmcenery/ppa

Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –keyserver keyserver.ubuntu.com –recv 3AE22276BF4F39C8D6117D7F4EA3A911D48B8E25
gpg: requesting key D48B8E25 from hkp server keyserver.ubuntu.com

gpg: key D48B8E25: public key “Launchpad PPA for Paul McEnery” imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

# sudo apt-get update

Now, install the driver (and it’s dependencies, which include  the library):
# sudo apt-get install ipheth-utils

Load the driver into running kernel
# sudo modprobe ipheth

At this point if you enter “dmesg” the last line should show something like “usbcore: registered new interface driver ipheth”

Step 3 – Plug your iPhone using USB cable
As soon as you connect your device a new interface should be plumbed, configured and ready to be used (in case you use network manager). You can get list of your interfaces with “ifconfig -a”. On your iPhone there suppose to be label saying “Internet Tethering”. If you don’t use network manager the “Internet Tethering” is triggered when you make DHCP request on that interface (for example, using “dhclient”).

That’s it. As promised, easy and simple. Thanks to Paul McEnery there are plenty of other cool iPhone related stuff you can install from his PPA (on Lucid).

Enjoy!

Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Slashdot
  • email
  • Print
  1. June 13th, 2010 at 20:26 | #1

    Thanks for the post. I thought iPhone tethering on Ubuntu would have been so complicated, that I didn’t even think to try it previously. Again, thanks for sharing such a useful guide. ^^

  2. June 17th, 2010 at 12:17 | #2

    Thnx for the help.. It worked

  3. June 18th, 2010 at 21:46 | #3

    Worked for me also! Thanks! Now I need to link my eth1 and my usb port so I can share the Iphone with other computers. But it says I am using eth1, I am confused I thought it was using the usb port.

    • June 18th, 2010 at 22:00 | #4

      The ipheth kernel module plumbs a new network interface. The operating system treats it just as any other network interface, however it communicates with the iPhone over USB. If you want to enable internet sharing, the fact it’s over USB shouldn’t make any difference.

  4. E Foster
    August 27th, 2010 at 22:22 | #5

    Can anyone here wake me through how to actually do this? Trying to decipher the IT lingo….

    • frishrash
      August 27th, 2010 at 23:07 | #6

      Can you be more specific?

  5. christopher.miller
    September 5th, 2010 at 03:08 | #7

    @E Foster

    Start by Opening Terminal and downloading the software.

  6. potic
    November 2nd, 2010 at 17:15 | #8

    worked for me too iphone 3gs 4.0x ubuntu 10.04 or smthing

  7. Thomas
    November 12th, 2010 at 09:25 | #9

    Hi guys!

    When I’m connecting using iPhone on USB like this (works great! Thanx for the post!) i get an eth1: device… I would like to route some traffic (an ssh-tunnel) through that. But when as soon as I enable the normal eth0 lan network my tunnel over eth1: seems to drop. Is the internet sharing automatically shut down by the iPhone when another network is detected? Any pointers?!?

    Btw: From Ubuntu 10.10 just add “ipheth-util” from synaptic and all software is installed (I needed a reboot though before it worked)…

  8. reibian
    February 5th, 2011 at 18:43 | #10

    Hmmmm. I’m SOL for this one. Just can’t get through the step 1. The rest is fine. Any alternatives? Thank you.

  9. reibian
    February 5th, 2011 at 19:59 | #11

    Ah, it is my fault to have updated my iOS to 4.2.1 It seems Apple has took out that functionality. arrrg. Can I down-grade?

  10. Stan
    February 12th, 2011 at 19:55 | #12

    Can anyone confirm that this works with os 4.2.1?

    I followed the instructions but I don’t get a new device with ifconfig -a.

  11. reibian
    February 24th, 2011 at 04:41 | #13

    @Stan
    Did you even get the iPhone to show the tethering option in the Network setting? I can attest this method does not work with iOS 4.2.1

  12. Sue
    March 19th, 2011 at 08:30 | #14

    I have 4.2.1 I did not see the tether option until I removed the ben help profile. Should I reload ben? Spool close I can almost….

  13. April 12th, 2012 at 11:19 | #15

    Do the following:

    sudo pico /etc/apt/sources.list

    … then add:

    deb http://ppa.launchpad.net/pmcenery/ppa/ubuntu natty main

    deb-src http://ppa.launchpad.net/pmcenery/ppa/ubuntu natty main

    sudo apt-get update

    sudo apt-get install ipheth-utils ipheth-dkms

    then update your iphone to 5.1

  1. June 13th, 2010 at 17:15 | #1
  2. June 14th, 2010 at 14:33 | #2
  3. June 15th, 2010 at 21:24 | #3