Sunday, October 5, 2008

How to share iphone's internet connection with you laptop using Wi-Fi connection, or say use iphone as a modem

This article aims to provide a way to connect your laptop with iphone using Wi-Fi connection, and use iPhone as the modem of your laptop, so you can have access to the internet with your iphone's 3G or 2G data service. This is really cool when you are at home and have a laptop, but you don't have internet access, either wired or wireless. The bandwidth is good, with this trick, you firefox is enabled to surf on the Internet.

Step 1: Jailbreak your iphone. (How to? I will write another article on how to do this. )
Before you do this, think carefully, because it violates the warrenty.

Step 2: Create a Ad-Hoc (device-to-device) connection using your laptop, in order to achieve this task, refer to my article for windows xp here, for mac os, I think it is also very easy.
Add your iphone to this network (Settings->Wi-Fi->enable Wi-Fi and choose the ad-hoc network)

Step 3: Install 3Proxy and Terminal

After jail broke iPhone, a Cydia icon will appear on one of the App pages. Load Cydia, and after self updating by Cydia, go to Install tab -> All Packages. Install both MobileTerminal and 3Proxy, then hit the Home button. The phone will restart and Terminal will be installed on iPHone Home screen. (refer to this page)
MobileTerminal enables you to run program with terminal as in linux.
3Proxy is for making your iphone a server using socks 5 protocol.

Step 4: Find your iPhone's IP address. 
This can be found by running "ifconfig" command in the terminal, but of course, you need to first install the package required for "ifconfig", search it in Cydia
Or, the easier way is the go inside the Wi-Fi connection by clicking the ">" sign of the current Wi-Fi connection in the "Settings->Wi-Fi" menu, write this address down in a paper.

Step 5: Open the terminal, type "socks" and click "return", it will hang there, it is fine, because the server is running and waiting for connection

Step 6:Run Safari on the iPhone and Open a Web Page
Launch Mobile Safari on iPhone and browse to any web page.
Note that this step is important to ensure that iPhone will internally switch itself and fallback to 3G GSM data connection when it fails to get through to Internet using the ad-hoc wireless connection, without dropping or terminating the ad-hoc network, allowing the SOCKS proxy server to transmit and transfer data via 3G network connection
(Each time when you find the iphone modem is not working, you should repeat this step)

Step 7: Configure Web Browser Fire Fox
Run Firefox web browser to configure proxy server for Internet traffic. In Firefox, go to Preferences -> Advanced -> Network -> Settings. Then, fill in the iPhone’s IP address written down from step 5 above into the SOCKS Host field, and enter 1080 as the port number.
Make sure all other proxy fields are blank and/or 0.

Step 8: Tunnel and Forward DNS Resolution Requests Through SOCKS Proxy
3Proxy SOCKS proxy can resolve target DNS names if the application sends domain name resolving requests to the SOCKS proxy. However, each application that requires to go to Internet via SOCKS proxy had to be configured manually, as most program will attempt to resolve a domain name against remote DNS server via HTTP protocol.

Firefox, for one, has such capability to force DNS resolution via SOCKS protocol. To enable such advanced option, type "about:config" into Firefox URL Location Bar. A huge list will appear, search for "socks" and change the value for network.proxy.socks_remote_dns preference to true (double click to change the value).
The DNS resolution limitation through SOCKS proxy also explains why some applications do not successfully browsing or connecting to Internet websites through tethering iPhone. However, once DNS requests have been cached locally, the domain will work system wide.

Now you can use the configured Fire Fox to go to any websites you are interested. You can do everything, even watch youtube videos smoothly.

(Don't forget to restore the changes that you made just now)
Step 9: Terminate socks proxy
After using the Internet connection via iPhone, terminate the SOCKS proxy server running on iPhone by switching back to Terminal, and then press and hold the Home button until Terminal quits, else it may slowly drain the battery life of iPhone.

Step 10: Change the fire fox configuration back, think what you did just now, and reverse.

Have fun!

7 comments:

Anonymous said...

Great blog you got here. It would be great to read more about this topic. The only thing I would like to see on that blog is a few pics of some gadgets.
Katherine Flouee
Block phone

Anonymous said...

Nice to meet you!I want to share you with the surprise. We are specialized in producing laptop batteries, like acer aspire oneacer aspire 3200acer travelmate 2200,,acer aspire 4310acer aspire 3100acer travelmate 4200Dell Inspiron 6400Dell Inspiron E1505Dell Latitude D620Latitude D600Compaq EVO N800Compaq Presario 900HP Compaq NC6000

HP Compaq NX9010

Compaq Presario C700Compaq Presario M2000Compaq B1900Dell Latitude CPIDell M65hp f2019ahp f1739ahp pavilion dv1000hp omnibook 6000hp Business Notebook 6510bAsus EEE PC 701Asus A2Asus A3000acer aspire 5500Dell B120 and so on, have high quality and reasonable price, if you need, you can just try, Hope you will like it.

Brad Fallon said...

How can I browse the Internet on my old Nokia phone (with no service) using my computer's Internet access?

dell laptop batteries said...

nice your blog and very nice dear your blog Ranking is too Good we like its you can see our also website for online shopping......
laptop batteries

Anonymous said...

How can i get my iphone internet to work after updating to iphone 4?

Herman Miller chair said...

Can an iphone 4 use itself as a modem with the additions iphone modem 4 app?

Blogger said...

Did you know that you can create short links with Shortest and make money from every click on your shortened links.