Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Due to a water leakage, we had to move offices temporarily. In our temp offices, we have WIFI network, but not cabled network (yet).

Since my computer doesn't have WIFI (it's a stationary desktop) I thought I could see if I could bridge my iPhone WIFI connection over to my computer via USB while I wait for local facilities to set up cabled network here.

Is this possible?

share|improve this question
add comment

5 Answers

up vote 3 down vote accepted

Sorry, but it's not possible to do this without jail breaking. The "Personal Hotspot" function on an iPhone only allows for sharing the 3G connection, not the wifi connection, so you can't use it as a wifi adapter. It's feasible that Apple could add this functionality, but it's a fairly niche case, so I wouldn't count on it.

More immediately, if you have a laptop with wifi available, you could use Internet Sharing (OS X)/Internet Connection Sharing (Windows) and an ethernet cable to get connectivity to your desktop. Or if you've got a Staples or something similar nearby, they usually have USB wifi adapters for $30 or less.

share|improve this answer
    
Hence why I started with this statement (which iPhone and iOS versions are you using? you will also need to check that your carrier allows a personal hotspot.) –  Graeme Hutchison Nov 14 '11 at 15:59
    
I think you're misunderstanding the question - the poster wants a way to use his iPhone to share the wifi connection over USB. The Personal Hotspot can only share the 3G connection. –  robmathers Nov 14 '11 at 16:28
    
No I'm not. If you read the last part I offer 2 alternatives as you can't do it with the iPhone –  Graeme Hutchison Nov 14 '11 at 19:45
    
"Not possible" is inexistent - you just might not be good enough to know about a solution. Rope's answer is correct. –  H2CO3 Sep 17 '12 at 13:23
add comment

Of course this is possible:

  1. Your iOS device must be joined to wifi connection
  2. Your iOS device must be jailbroken
  3. Your PC must have iTunes on it
  4. Install MyWi 5.0 over Cydia (Cydia will be installed on your iOS device after you jailbreak it)
  5. Choose USB tethering in USB tab
    • Set MyWi USB to ON
    • Go to Advanced USB
    • Set USB Bridhe to "Bridged to WiFi" so you don't get online via 3G
  6. Enjoy your wireless internet connection
share|improve this answer
    
From the vendor's site‌​: One great example is your iPhone may have access to a HotSpot for free that also allows tethering. Thus, you can use your iPhone's WiFi to connect and use the USB connection to allow your internet to pipe/bridge it's traffic through the WiFi connection. –  iolsmit Mar 1 '12 at 2:49
add comment

which iPhone and iOS versions are you using? you will also need to check that your carrier allows a personal hotspot.

if you are able to turn on a personal hotspot on your phone, just connect the phone to the PC with a USB and enter the Wi-Fi password after finiding teh phone in the network settings.

enter image description here

You could also just get a WiFi USB which would pick up the WiFi from the router.

share|improve this answer
add comment

Free method that works, with a jailbroken iPhone at least:

1) Install openSSH on your iPhone from cydia, or apt-get, if you prefer the terminal.

2) Install python 2.7.x.
     As of this writing the latest version is 2.7.6.

3) download libusbmuxd.
     https://github.com/libimobiledevice/libusbmuxd
     You can either do a git clone or, if you don't have / want to get git, download
      the release from the 'releases' tab.

4) unpack it if you didn't take the git clone route. If you downloaded the tarball,do
     tar zxvf <tarball name>.tar.gz from a terminal. In windows, use 7-zip or download the .zip version of the tool.

5) cd into libusbmuxd/python-client.

6) The following step is platform-dependent:

Windows

If you run windows, you will have to manually type the path to your python.exe program. If you chose the default location, it will install into C:\Python27. So, in windows, go to your command prompt and type
C:\Python27\python.exe tcprelay.py -t 22:2222.

Linux/Unix/Solaris/BSD, etc.

If you use Linux (like me), Cygwin in Windows, BSD/Unix, solaris, or basically any platform besides windows and DOS known to man, you will simply type
python2.7 tcprelay.py -t 22:2222.


7) Not quite done yet - You need a SSH client running! This, too, is platform-dependent.

Windows - PuTTY

In windows, cygwin makes this easy, but if you don't have cygwin already, PuTTY is a good option:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Set it up like this:
Setting up puTTY - 1
Setting up puTTY - 2

Be sure to set the login username to 'mobile'. Setting up puTTY - 3

And, for a little extra speed (lower overhead from the encryption), change the encryption to 'arcfour'. Usually, I would not recommend this, but since you are pushing the encryption over a USB cable and not a network, security is less of a risk.

Setting up puTTY - 4

If you want, you can then save a profile for this, to avoid setting it all back up each time you have a problem. This is done in the 'session' section at the very top.

Linux/Unix/BSD/Solaris/OSX/HP-UX/whatever I'm still missing

You can run ssh -D 8080 -p 2222 mobile@127.0.0.1 The default password for the mobile and root accounts on the iphone should be alpine. Once you are successfully logged in, you should see a xterm-like window. type passwd now, to change your password to something more secure. Also, type su and use alpine as your password to log in as root and change the root password as well. Then, type exit to go back to your login as mobile.

8) You're nearly done now, I swear! It's less complex than it appears so far, if you actually do it yourself!

Now, you need to open your web browser of choice; I use firefox, so I will use it as an example. I have used chrome, but as I do not like it and do not currently have it installed, I cannot presently use it for an example. But you set it up as a SOCKS proxy, regardless of browser.

These screenshots were done with a forwarded X11, so the fonts are ugly, but pay it no mind.
First, go to the preferences window (tools -> options or edit -> preferences, depending on OS). Then, go to Advanced -> Network -> Settings.... Firefox Configuration 1

Use the following configuration for the browser.
Firefox Configuration 2

Problems and Solutions

Problem:

Yeah, this isn't really using the iphone as a modem.

Solution:

Get over it; it works.

Problem:

My app doesn't allow setting a SOCKS proxy.

Solution:

I have had this problem with games like Minecraft. Here's some fixes.
For minecraft, I added a argument to ssh. I regularly play on the nerd.nu reddit minecraft servers (reddit.com/r/mcpublic). Since minecraft 1.6, SSH tunneling and SOCKS proxies set as command line arguments haven't worked. You used to be able to add java parameters -DSocksProxyHost=127.0.0.1 -DSocksProxyPort=8080 and it would work. Now, however, the solution isn't quite as nice, but it does work.

When you start ssh, instead of ssh -D 8080 -p 2222 mobile@127.0.0.1, do
ssh -D 8080 -L 127.0.0.1:25565:p.nerd.nu:25565 -p 2222 mobile@127.0.0.1.
Then, when you want to connect to the server, instead add the URL 127.0.0.1:25565 to your list of servers! The remote server will appear on 127.0.0.1/localhost thanks to the miracle of SSH tunneling!

For other programs/games, the same rule applies. If you can't set a SOCKS proxy and nothing else works, just add -L 127.0.0.1:<port>:<remote URL to access>:<remote port>.

There is nothing forcing you to use the same port on 127.0.0.1 that you would normally, so I could have, for example, mapped p.nerd.nu:25565 to 127.0.0.1:1025 and the game wouldn't care as long as I specified the port. Not all programs are so lenient, but it's useful to remember.


Also, remember: Nearly any program can use this. So while it's not as nice as having a simple modem or something, It definitely works. Note that if you lose connection to wi-fi, you will probably start eating into your cellular network's data access. If the cellular network does deep-level packet inspection, be prepared for a charge for enabling tethering. Just be careful, please :) If you have "TetherMe" from Cydia, or something like that, it might mask what you are doing. Also, sometimes if the iphone goes to sleep it will turn off wi-fi. Install insomnia from cydia/apt to get around that.

Or, to prevent deep packet inspection, you can also SSH from your iphone into a PC at home for encryption, and then SSH into your iphone from your device that you are wired into.

share|improve this answer
    
Sorry if this is too long; I just feel really, really proud to have finally figured out SSH tunneling so well. It really is THE most useful thing ever. (Just wrote this on my laptop from a car) –  Wyatt8740 Apr 17 at 14:01
add comment

just download virtualwifirouter for free , install and configure it once ....... and enjoy for life time :) .........

share|improve this answer
    
Could you elaborate a bit on this? It's not really a comment and not enough to stand alone as an answer. –  bmike Feb 23 '13 at 20:12
add comment

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.