找回密碼
 登記成會員
搜索
查看: 21094|回復: 8

怎樣利用iphone來讓macbook pro 上網

[複製鏈接]
發表於 27-6-2009 03:26:04 | 顯示全部樓層 |閱讀模式

登記成為會員,看更多精采內容!

您需要 登錄 才可以下載或查看,沒有賬號?登記成會員

×

Use Your iPhone's Internet Connection On Your Laptop


It's great that your iPhone has a data plan and a killer mobile browser, but when you're sitting at the airport waiting to catch a plane with your laptop right next to you, wouldn't it be nice to use your full-on desktop browser? Out of the box your iPhone won't allow you to tether your EDGE data connection to another computer wirelessly, but with a little ingenuity on your part you'll be browsing the net on your laptop through your iPhone's data service in no time.

NOTE: You're probably asking yourself: "Isn't the EDGE data network that the iPhone uses SLOW?" Well, yes it is. But if you're at all like me, sometimes a slow full-screen browsing session is better than slow browsing on the small screen.

I've only tested this method on my MacBook Pro, but since SSH is platform independent, this should be a workable solution on Windows, Mac, or Linux.

What You'll Need

For this guide, you'll need:

Prepare Your iPhone

install-ssh.jpgAssuming you've already got Installer.app installed on your iPhone (which you will have installed if you've gone through the jailbreak mentioned above), the first thing you need to do is install OpenSSH. So head to your iPhone's home screen and fire up Installer.app. Now go to the Install tab and tap on System -> OpenSSH and tap the Install button. Once it installs, exit Installer.app.

Start Up Your Ad-Hoc Network

This process differs depending on what operating system you're using. As I said above, I've only tested this on a Mac, but I'll point to instructions on how to do the same on Windows as well.

ad-hoc 1.pngIf you are using a Mac, just click the Airport icon in your menu bar and click on Create Network. Then just give your network a name and—if you like—a password.

On a Windows PC you'll need to set up Internet Connection Sharing. You can find instructions for doing so here. Good luck!

Once you create your network, your computer won't be able to connect wirelessly to any Wi-Fi hotspot, just other devices.

Connect Your iPhone to Your Computer

connect-to-network.jpgTo get your computer and iPhone talking, you'll need to connect your iPhone to the ad-hoc network we created above. To do so, go to the Settings application, tap Wi-Fi, and select your ad-hoc network from the list of available networks.

ip-addy.jpgOnce you're connected, tap the blue arrow next to your new network to get info on your connections—namely your IP address. Write that puppy down because you'll need it in a second.

Connect Your Computer to Your iPhone's Internet

Now it's time to make use of the SSH server we installed on our iPhone. From this point on, we're basically following our previous guide to encrypting your web browsing with an SSH SOCKS proxy. Open up your command line application of choice and enter the following:
ssh -ND 9999 root@YourIPAddress

...where YourIPAddress is replaced with whatever you wrote down above.

If this is the first time you're SSHing into your iPhone, it may take a bit for your secure key to be generating, so give it at least 30 seconds. You'll be asked if you're sure you want to continue connecting (answer "yes") and then you'll be prompted for a password. At the time of this writing, the default password for OpenSSH on your iPhone is alpine, though you should change the root password when you get a chance.

After you've entered the correct password, the prompt will appear to hang. That's actually what should be happening, so you're on the right track.

Set Your Browser to Use SOCKS Proxy

At this point you just need to set your browser or operating system to use the SOCKS Proxy we've just set up to route our internet connection through the iPhone's EDGE connection. Gina's post shows how to do this with Firefox, though I'll admit I had some trouble getting the proxy to play properly with Firefox on my Mac. Your mileage may vary, but as an alternative I'll show you how to set it up in Safari, which worked well for me.

First, open the Safari Preferences, go to the Advanced tab, and click the Proxies "Change Settings" button. Make sure you're looking at your Airport advanced settings and are viewing the Proxies tab. Tick the SOCKS Proxy checkbox, enter localhost in the section labeled SOCKS Proxy Server and 9999 in the port next to it. Hit OK and Apply your settings. Then just head back to Safari and you're ready to browse.

Couldn't This Work Better?

I'll admit that my SSH/SOCKS chops are slim, so it's very likely this method could be built on to work even better than what I've set up above. That said, I can now browse from my laptop for free anywhere I've got my iPhone, so it could be worse. There are other methods available for tethering your iPhone, particularly this one, but I like the comparatively easy setup and cross-platform-ness of my setup. Alternatively, if you're feeling particularly adventurous/bored, you can boost your iPhone connection to 3G speeds by tethering the iPhone to a 3G mobile phone (which would be absurdly cumbersome). Tethering your iPhone to your laptop may be against AT&T's terms of service, so keep that in mind if you decide to go forward with this. If you've tried this or a similar method and have your own tips, let's hear them in the comments. Thanks to Lifehacker reader Vinod Panicker for the great idea.

If you're looking for more cool ways to put that iPhone to use, check out my iPhone book.

Adam Pash is a senior editor for Lifehacker who enjoys a good iPhone hack—hell, he wrote the book on it. His special feature Hack Attack appears every Tuesday on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.

 樓主| 發表於 27-6-2009 03:29:08 | 顯示全部樓層

另一個方法…

http://www.iphonemodem.com/

What is iPhoneModem

iPhoneModem enables sharing of the iPhone's Internet connection with your Mac or PC.

It's a beautiful, simple and small footprint application for the iPhone and the Desktop computer that anyone can use on a few seconds.

iPhoneModem is available for Jailbreaked devices using the cydia package manager on the phone.

To make connecting a one click task, you should also download the helper application for your computer.

What's new

1. Window Vista / XP and MacOS support

2. Very strong Socks Proxy

3. New HTTP/HTTPS and DNS proxies

4. Traffic monitoring

5. Even more apps now suported

6. iPhoneModem can now run in background for registered users

7. New user interface


發表於 27-6-2009 03:36:27 | 顯示全部樓層

回復 2# 的帖子

有 wifi 就直接上啦 , 駁 iphone 做咩呀 ?
發表於 27-6-2009 09:20:24 | 顯示全部樓層
可能佢經電話既生滋網絡來上 小弟以前係人仔年代都係用電話+bt來用notebook上網,速度仲
發表於 27-6-2009 18:45:13 | 顯示全部樓層

回復 4# 的帖子

我依家仲係用緊 Peoples $98 經電話駁 iBook
發表於 27-6-2009 20:09:45 | 顯示全部樓層
原帖由 egg_studio 於 2009-6-27 18:45 發表 我依家仲係用緊 Peoples $98 經電話駁 iBook

如果全文字網頁都ok
假如有圖.片.flash既網頁,你真係想
發表於 28-6-2009 10:07:12 | 顯示全部樓層

回復 6# 的帖子

上小陣會死咩 ....
發表於 28-6-2009 12:50:10 | 顯示全部樓層

原帖由 wongfai 於 2009-6-28 10:07 發表 上小陣會死咩 ....

唔使死,不過有 Notebook 為求方便,都係想找個方便而可靠d既無線上網方法 ~~

發表於 28-6-2009 13:39:17 | 顯示全部樓層
原帖由 c_Foo 於 2009-6-28 12:50 發表 唔使死,不過有 Notebook 為求方便,都係想找個方便而可靠d既無線上網方法 ~~

C_FOO兄我諗你誤解左wongfai兄既意思la
wongfai兄,上少陣真係會死,一日不(keyboard上h右邊的鍵),如格(錯別字)三秋啊
您需要登錄後才可以回帖 登錄 | 登記成會員

本版積分規則

聯絡|手機版|香港大笪地

GMT+8, 22-11-2024 10:11 PM

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回復 返回頂部 返回列表