Using system wide socks proxy with iphone tethering

apple-imageRecently I discovered a program called proxifier, a OS X Leopard program that will send all network traffic through a defined socks proxy server. So instead of defining the proxy settings in each individual program, simply turn on proxifier and redirect all the network traffic.

proxifier is the same thing as WideCap or FreeCap in the Windows side. tsocks for OS X may work as well.

So why is this important? Well, I’m on the road a lot and with a iPhone 3g that’s jailbroken you can install a socks server called 3proxy through the cydia installer and with proxifier you can route all your network traffic on your Mac through your new socks server at 3g speeds. This means I can get email, surf the web, use skype, etc. all through the iPhone

Here’s the steps for a mac. It’s not that hard…
Create a ad-hoc network on the mac?by using the “Create Network…” option.?I called mine “sweet”
Set a static IP for your mac on the ah-hoc?network you created. I like to use?10.10.10.5
You need to have your iPhone jailbroken?and have 3proxy installed. Search the web?for details on how to make this happen.?I like quickpwn.
On your iphone, select the network you created on your mac, “sweet” for me, and set iPhone’s static IP address. 10.10.10.10 will do nicely.
Now, run /usr/bin/socks on your iphone. I like to set mine up in Boss Prefs so I can turn it on and off easily.
On the mac, run proxifier, and point it to the socks proxy IP address of 10.10.10.10 port 1080. Your done!

This looks like a pain, but if you create a network location with the IP settings, and use Boss Prefs with the iPhone, this process can be done within 20 seconds. And with FW 2.1 on the iPhone 3G the speeds are very impressive, and I even found I can answer a call while I’m surfing through the socks proxy. Make sure to turn off the socks proxy when your not using it otherwise you’ll find that your iPhone battery will run dry quickly.

I also did some research on using pppd and slirp to create a complete network tunnel to the 3g network on the iphone. It appears that FW 2.x has broken slirp and it may be related to a kernel update the may have nuetered ipfw. Bummer. The following command will start a pppd session and will provide a ppp0 network interface. The problem I found is I couldn’t get the iPhone to bridge the networks. pppd is already on both OS X and the iPhone, but you need ssh on the iphone to play.

wopr # touch /etc/ppp/options  #Only need to do this once.
wopr # pppd 10.10.20.5:10.10.20.10 netmask 255.255.255.0
  noauth passive debug logfile /tmp/ppp
  pty "ssh [email protected] pppd notty noauth debug logfile /tmp/ppp"

If you have any comments I would love to hear from you.

Other Links:
http://www.appleiphoneapps.com/2008/08/how-to-tether-your-iphone-without-netshare-mac-walkthrough/
http://www.nsgn.net/better_iphone_tethering/overview.htm

0