Following my post about iPhone + Linux tethering which used wireless to connect the laptop to the iPhone, I started to encounter a few problems with the solution. The main problem I found with this method was setting up the adhoc wireless network. It ALWAYS seemed a fiddle. So I started looking for a way to use the USB cable to connect the iPhone to the laptop and use that for connectivity. The answer was iTunnel! Here is a quick HOWTO for using it. I have sucessfully run this on Ubuntu 8.10 and 9.04.
A Jailbroken iPhone running SSH.
WARNING: DOING THIS BREAKS YOUR iPHONE WARRANTY AND AGREEMENT WITH YOUR CELL/MOBILE PROVIDER: DO THIS AT YOUR OWN RISK!
Download iTunnel from: http://www.cs.toronto.edu/~jingsu/itunnel/itunnel-0.0.5.tgz to your laptop.
Open a shell and type:
tar xvfz itunnel-0.0.5.tgz
mv itunnel-0.0.5 itunnel
Running the tunnel.
Plugin your iPhone via USB cable:
The first time you run this it may fail and unmount your iPhone’s camera folder. Running it for a second time you should be shown the following in the shell:
- successfully got device
server waiting for ssh connection
In a second shell now run the following command, which SSH’s to the new tunnel and sets up a SOCKS proxy on port 9000 for you:
ssh -D 9000 -p 3023 127.0.0.1
Leave both shells open, whilst you wish to be connected to the internet.
Open Firefox and in the url bar enter:
Now set its value to true. This allows the iPhone to resolve the DNS for firefox rather than the laptop, as only the iPhone has true internet connectivity to do DNS requests.
Now still in Firefox go to Edit > Preferences. Choose the Advanced section and the Network tab. Now click the Settings button and Select Manual Proxy Configuration. Enter the following
SOCKS Host: 127.0.0.1 Port: 9000
Your now ready to browse the internet from your laptop without fiddling about creating a adhoc wireless network! To close the tunnel just hit CTRL+C in the the iTunnel shell.