In previous manual I have described how to connect your PC to GPRS/EDGE Internet provided by iphone via USB cable. This outstanding result achieved with the help of small utility called iTunnel.exe from Iphone Tunnel Suite released recently. SSH protocol is used to provide the connection between the PC and the iphone.
Now I will try to explain another way of communication the iphone can use. We will connect it to the Internet-connected PC via standard USB cable and get the iphone online in this passthru, reverse mode. Without wifi, without GPRS/EDGE fee to GSM operator. Incredible, impossible? Read further...
The PC:
iTunes should be installed on the PC (UPDATE: iTunes 8.2/9 should be used for iphone OS3.x), moreover you may need .NET Framework 3.5 to be installed in order to make it work. By the way, I managed to start it on Vista Home Premium SP1 with its native .NET Framework 3.0. Iphone Tunnel Suite is not needed. Instead you need to download only a core part, the iTunnel.exe, one supplementary dll (iTunesMobileDevice.dll) and startup cmd-file. The link to itunnel.zip is below:
http://www.mediafire.com/?tnaqjzw0mnd - for OS2.x
http://www.mediafire.com/?tlmdkorzmyq - for OS3.x (iTunesMobileDevice.dll from iTunes 8.2)
http://www.mediafire.com/?2q1fzowoy12 - for iTunes 9 (iTunesMobileDevice.dll from iTunes 9)
For ssh access I am going to use Bitvise Tunnelier but you can try any ssh client you like. In particular, Tunnelier Portable is excellent GUI ssh client with clear interface and good help file. It doesn't need to be installed on the computer and can be started even from USB flash drive. Download it from here:
http://tp.vbap.com.au/download
The iphone:
You must have OpenSSH installed on the iphone. I recommend to have Bossprefs as a toggle tool in order to enable SSH server and for some other tricks below. Disable wifi to avoid any interference.
Make sure your gprs/edge settings (APN etc.) are entered in the iphone and it reliably works over gprs/edge. We need it only to be sure that gprs/edge network interface is OK.
1-4. The first three steps are the same as in previous post. Extract TunnelierPortable and itunnel.zip if didn't do it before, locate Runtunnel.cmd and be ready to start later. Start TunnelierPortable.exe, if you save your profile before, the program will autoload it after start. Check settings according to the following screens, some of them need to be changed.
Login - enter 127.0.0.1 into the Host field, the Username is root, the initial method is "password". The password is alpine (if you didn't change it). You can store the encrypted password in the profile if you like.
For better security you can use key pairs for authentication but this item is out of current guide, see ssh manual for details or wait for my further posts on it.
Options - notice two check boxes at the top right corner. Enabling "Open Terminal" and "Open SFTP" you can use internal Tunnelier Terminal and SFTP client (WinSCP-like) to access the iphone after the connection.
I recommend you to enable them both now, you may need them later.
* * *
Services - in previous post it was important option to enable socks-proxy on the PC. Now we don't need this option. Please uncheck SOCKS/HTTP Proxy Forwarding on the Services screen if it was Enabled before.* * *
Client to Server Forwarding - if you have any entries here (left from previous exercise) disable or delete them on this screen. Later you can save settings in a new profile making previous profile intact and keeping all your socks and C2S entries.And finally:
Server to Client Forwarding - the most important new screen in this guide. It contains entries for so called reverse port forwarding (-R in OpenSSH) through the ssh tunnel. This is the most incredible point in the huge list of ssh protocol capabilities. Let me explain it briefly. In prevoius guide and in this one the PC is ssh client while the iphone is ssh server. After the connection between them ssh allows not only reach some external sites through the forwarded ports from client to server but in the reverse direction, from server to client too. It means that if our PC acting as ssh client is connected to the external network (via Ethernet or wireless connection) the ssh server will be able to reach client's network too. Unfortunately, this can not be made directly, for any of this connection we should provide the "reverse tunnel" between client and server.
OK, what should be done for iphone?
We need http proxy for all http-based native iphone applications. If you don't have proxy server in your LAN you need to install some personal and easy to configure proxy server on your PC. I recommend privoxy (www.privoxy.org), it is free open-source proxy server well-known with its good ad-blocking filters. Installation is straight-forward, privoxy is ready to use immediately after setup is finished.
Start it, you will notice blue circle with P in your tray. Double click on it will open main privoxy window. Optionally you can make privoxy to be more informative. To change its config choose Options/Edit main configuration, privoxy will open it config.txt, find section 3.1 debug and uncheck this part in it:
debug 1 # log each request destination (and the crunch reason if Privoxy intercepted the request)Save config.txt, privoxy will accept changes immediately. It will give you more information in Privoxy window when connection will be made. The default http port it uses to serve client's requests is 8118.
debug 4096 # Startup banner and warnings
debug 8192 # Non-fatal errors
Let's return to S2C Forwarding screen, you may notice that its first entry prepares the tunnel to provide the requests from the iphone to the PC over port 8118. Then we have another issue.
How to force the iphone to use http proxy on its primary, gprs/edge interface?
There is no menu in iphone settings to change it (unlike the wifi), it is not documented but it is possible.
The trick is to change the iphone's preferences file in the following location.
/private/var/root/Library/Preferences/SystemConfiguration/preferences.plist (for 1.1.1 firmware)
or
/private/var/preferences/SystemConfiguration/preferences.plist (for 1.1.3 or higher)
The recommended way is to copy this file from iphone to your PC using sftp-interface of Tunnelier (see later), modify it with some text editor, for instance Wordpad, save, check the name of the modified file doesn't contain .txt ending and copy it back to the iphone.
What should be modified in preferences.plist? You need to add section responsible for using proxy autoconfiguration file there. Locate the part shown below and append it with a text in blue color:
<dict>
<key>Interface</key>
<dict>
<key>DeviceName</key>
<string>ip1</string>
<key>Hardware</key>
<string>com.apple.CommCenter</string>
<key>Type</key>
<string>com.apple.CommCenter</string>
<key>UserDefinedName</key>
<string>com.apple.CommCenter (ip1)</string>
</dict>
<key>Proxies</key>
<dict>
<key>ProxyAutoConfigEnable</key>
<integer>1</integer>
<key>ProxyAutoConfigURLString</key>
<string>file:///private/var/preferences/proxy.pac</string>
</dict>
...some more entries which we don't touch
In this file we add the link to proxy autoconfiguration file proxy.pac in /private/var/preferences directory on iphone. The file contains proper address for the proxy server.
When the iphone is connected to the PC via USB cable proxy.pac must be:
function FindProxyForURL(url, host)
{ return "PROXY 127.0.0.1:8118"; }
If you need to get access to gprs/edge outdoors proxy.pac must be just:
function FindProxyForURL(url, host)
{ return "DIRECT"; }
Update: Starting from fw 2.2 you don't need to switch back to "DIRECT" in proxy.pac. I noticed that Safari and other http-based iphone applications start working over GRPS/EDGE again if there is no cable connection despite the proxy.pac remains with PROXY 127.0.0.1 inside. So the rest of section 1-4 (EdgeProxy plugin etc.) could be easily skipped to section 5 and kept here for historical reasons only. Anyway, if you prefer to switch proxy mode on and off you, sure, can use the method described below.
To simlify the task I have already prepared these files for you. Download edgeproxy.zip from here
http://www.mediafire.com/?ymkdc9zmjjh
In addition, I have made the plugin for BossPrefs 1.73 allowing to toggle proxy.pac thru BossPrefs interface.
Please find detailed manual in the Readme.txt inside.
Note the archive doesn't contain proxy.pac directly, but only two pattern files: proxy.edge and proxy.off.
Enabling EdgeProxy ON should copy proxy.edge to proxy.pac, create signal .pid file and REBOOT the iphone in few seconds to enable proxy settings. After restart BossPrefs will show you the right status of the EdgeProxy. So now the iphone is ready for connection via USB.
When you need to disable proxy start BossPrefs again and flick the EdgeProxy OFF. BossPrefs will copy proxy.off to proxy.pac, remove .pid file and REBOOT the iphone to make changes.
On my 1.1.1 firmware everything is working fine. I am not sure it will be so easy on more newer versions because of changes (user mobile) in BossPrefs execution of plugin commands.
Update: Everything is OK here with 2.0.2 iphone and latest Bossprefs. So please use the plugin.
Anyway, you know that through the Tunnelier Terminal connection (started with root credentials) you can make some copy commands manually or just prepare simple .sh scripts to automate the task.
See my scripts here as an example of those scripts.
OK. Now everything is ready to start.
5. Connect the iphone to the PC with standard USB cable, be sure that SSH server is enabled on the iphone. Be sure your PC is connected to the Internet.
6. Launch the Runtunnel.cmd mentioned above. If you didn't start it before notice Windows Firewall warning and add iTunnel to the exceptions list. You will see the black console window contains nothing except the itunnel.exe 22 22 command. Do NOT close this window, it should stay opened during the whole connection session, later you will notice some messages there proving that tunnel is working.
7. Press Login button in Tunnelier. First time the client will ask you to accept the host key from ssh server (your iphone). Accept it and look at the Tunnelier lower pane for log of the connection. If you enable Terminal and SFTP check-boxes Terminal and SFTP client windows will be opened.
You can use SFTP to copy preferences.plist forth and back to arange proxy access if you didn't do it before. You can use Tunnelier Terminal to execute commands to replace proxy.pac if BossPrefs failed to do it.
If everything is fine with preferences.plist and proxy.pac after the ssh connection you can start Safari on your iphone. Safari should start working over proxy server on our PC, you can see some entries in privoxy main window if you enable extra debugging options in privoxy config above. It means that our goal is reached! Open http://2ip.ru or http://www.whatismyip.com in Safari to make sure that your ip address is the same as on your Internet-connected PC. Try other iphone applications - Weather, Stocks, Maps, YouTube, iTunes, Cydia. Anything that use http to access will be forwarded thru reverse tunnel from ssh-server to ssh-client and appears as local proxy request to the privoxy proxy server. Fine. Our wildest dreams come true!
In addition, if you have some other proxy server in your LAN, for instance, in your office you can connect the iphone to it directly. In this case you don't need privoxy. Assuming this proxy server address is 192.168.0.10 and port 3128 we can change our S2C settings as shown below.
Now we put 192.168.0.10 in Destination host field and 3128 in Destionation Port. All requests from the iphone to LAN proxy server will look like the requests from your PC so you don't need extra permissions.
Well, but what about Mail? It doesn't use http for access. Look at the S2C Forwarding screen again, two additional entries are two additional reverse tunnels to provide access to gmail imap and smtp servers. If you use another mail providers please change the Destination host and port accordingly. The only drawback is that you need to change Mail settings in the iphone menu, so instead of real mail server name or ip address you should enter 127.0.0.1. In my gmail example it should look like this:
Please note that if you do not change settings for email accounts Mail will still be working over gprs/edge wasting operator's traffic despite the iphone is connected to the PC via USB cable.
If you use some other native iphone applications that should be connected over their own ports please add extra entries in S2C Forwarding screen with Destination Host and Port used by these applications. In configuration of the application don't forget to choose 127.0.0.1 as its server address in order to tunnel the connection from telephone to computer via USB cable. Remember, ssh can tunnel TCP-based connections only.
OK, the long guide is finished, it was longer than I thought before start. I hope you managed to fulfill the mission. If not please check back all settings, screenshots and files. Don't be hurry. Try again and you will get it as I am.
If you have question, remarks or additions feel free to apply it to me by email. I will try to help.
161 comments :
hi this is nice but i just want to ask if this works for firmware 2.0.1? tnx and great work
yes, as far as i know it works with 2.0.1 firmware so you can try.
I tried the procedure, but can't work it through to get my iPhone (1Gen, with fw2.0) online through PC internet.
Did anyone have success story at fw 2.0?
I confirm that everything is working fine at jailbroken fw 2.0.2 which I upgraded to recently.
Works on 2.0.2 firmware fine and on the iPhone 3G, only thing i need to do to make it work was disable 3G.
Would it be possible to tether my iPhone's wifi connection to the PC instead of using 3G/Edge?
Hello everybody,
alk I've word to say "Thank you for your great post". From this post you can use IE, MSN and many TCP Client.
Please visit my website.
Current only Thai language sorry for that.
But you can see only picture for small guide.
http://sixhead.com/2008/08/27/share-internet-with-iphone-ie-msn-tcp-ip-client/
My iPhone has no wifi connection, so I'm trying to use this tutorial to get it online via usb cable.
But iPhone never succeeded to send request to Privoxy (no any request information on the debug window). But when I set Firefox on PC to use 127.0.0.1:8118, Privoxy did received bunches of request, shown on the debug window.
Both preferences.plist and proxy.pac was modified, and togglable by BossPrefs. So I doubt whether or not iPhone has been forced to use http proxy of my PC. Is there any method to check if this server2client forwarding is configured successfully?
You can check the status of S2C connection(s) on Tunnelier lower pane after Login.
Every new request from Safari over 127.0.0.1:8118 can be seen there.
Another way to be sure that you are connected over PC is to check your external ip-address in Safari opening some site like www.whatismyip.com or 2ip.ru.
Alk,
There's no any request shown in lower pane of S2C connection(s) tab on Tunnelier. When I typed 2ip.ru or any other URL in safari, iPhone just told me "Safari can't open the page because it is not connected to the internet" ;-(
It's obviously my iPhone didn't forward the http request to PC:8118. I tried traceroute one address in iPhone, but got below msg,
localhost:~ root# traceroute 88.198.46.171 64
traceroute: ifaddrlist: SIOCGIFADDR: pdp_ip1: Can't assign requested address
I don't know the correct response with successfully forwarding forced iPhone.
BTW, my iPhone is 1st Gen, 2.0.2 firmware, with grey NO WIFI.
Could you pls help me out?
Perhaps, edge network interface doesn't work on your iphone at all. Try to connect to your carrier's gprs/edge network before doing any proxy tricks.
Check APN in iphone's General/Network settings.
Grey nowifi is a bad sign too.
Alk,
I was not aware of that this method needs iPhone with Edge/GPRS enabled. My cellphone don't have edge/GPRS support.
I supposed iPhone will request any internect request to PC through USB in this guide. What role does edge/GPRS play here?
Thanks!
It's essential to have gprs/edge "network interface" in active state to get the ip-address to iphone gprs/edge "network card". The ip-address is dynamically assigned by the carrier's server upon telephone registering in carrier's network (I guess). BossPrefs shows Edge's ip-address in its main screen.
So you should at least subscribe to gprs/edge services to proceed with USB connection.
Hi Alk,
Thank you for a very informative guide! I have a 1st generation iPhone with 1.1.3 firmware, and I dont have an EDGE subscription. Therefore I cant get online with the iPhone+USB cable. I was thinking maybe we can switch the wifi on, and give it an IP using "ifconfig en0 10.0.0.3" or the sort. I see in BoosPref that the IP address is assigned but couldnt go through to the PC. What do you think?
Thank you!
Hello . I try to access 127.0.0.1:8118 from iphone and i recive this meeage on tunnelier " Failure opening client-side server-2-client connection from 127.0.0.1:49240 to 127.0.0.10:8118: Connect() failed: Windows error 10061: No connection could be made because the target machine actively refused it.
"What i need to do? Thenx
poiqwe said...
and I don't have an EDGE subscription. Therefore I cant get online with the iPhone+USB cable. I was thinking maybe we can switch the wifi on...
I think it's hardly possible. Either you should use EDGE and USB-cable or just wifi ad-hoc connection to the computer to pass through the iphone online.
Funn said...
and i receive message on tunnelier "Connect() failed: Windows error 10061: No connection could be made because the target machine actively refused it."
Please check the firewall.
Good job alk!
One question. can i get it on my ipod touch...?
Brezeck said...
can i get it on my ipod touch...?
Unfortunately, not.
ipod touch doesn't have gprs/edge network interface to redirect it to the proxy.
Great job, man.
Let me translate this post into my languague - Vietnamese and leave a backlink on you.
Thanks for your post ;-)
DragonX said...
Let me translate this post into my language...
You are welcome.
For your reference here is a link to my original post in Russian if it can help.
I have the 2.0.2 and it's woking fine
Great job
Hi!
great job! i have looked for this for a long time.
but i have problem and please help me. :)
i did everything ( maybe correctly ) and i get this massage in tunnelier :
"
connected
Starting first key exchanging
Server disconnected without sending a disconnect message.
"
how can i help this?
i'm on vista and i have 2.1 firmware on iphone .
Thanks to Alk, google and Steve Jobs:)
iPhone 2g 2.1 works fine online over USB via PC internet connection. My iPhone has no wifi. So it's good way online. And've faced two problems while had been setting up. 1) EDGE should be on, but to be sure it will not connect over it i typed wrong APN. 2) i had "bind error" with iTunnel. May be it's because iTunes block iTunesMobileDevice.dll i.e. soket. So restart PC and do not start iTunes. After that works fine.
Hi alk, i hope you can help me with some kind of a problem.
I have an 2G iPhone with 2.2 firmware, SSH Installed and everything, Vista on my computer.
I followed your guide and I still have some problems connecting.
When i type 127.0.0.1:8118 in Safari, I get this error "Invalid header received from client". Privoproxy's error is "127.0.0.1's request: 'GET / HTTP/1.1' is invalid. Privoxy isn't configured to accept intercepted requests.
". When i modify accept intercepted requests to 1 still nothing.
Any ideeas? Sorry for my bad english
Alex said...
When i type 127.0.0.1:8118 in Safari, I get this error "Invalid header received from client"...
You don't need to enter this address in Safari. It is already entered in proxy.pac file, the proxy server address.
In order to check the connection enter http://2ip.ru in Safari and see the ip-address it will show to you in reply.
It shows the cellular data IP address. Not the computer IP Address. I'm out of ideas, i tried everything many times.
alk
I have edge and wifi both but my lappi's wifi not working, i nvr used my edge after i upgrade from 1.1.3, to 2.2. is it necessery to connect once to edge connection? or do i need to switch on egde as well ?,
I have been trying to download EdgeProxy.zip, to no avail, is there another location that works?
Thank you
Crouzilles said...
EdgeProxy.zip no avail, is there another location that works?
Perhaps, mediafire was temporary down, now it's available. Anyway, you can download it from here
How to install OpenSSH on iphone without any network and wifi?
eugen asked...
How to install OpenSSH on iphone without any network and wifi?
See my reply here
nice work...
but how does it work with an apple mac computer ?
This is excellent - thanks alk for your posting and sharing. Got it working on firmware 2.2 via laptop on XP. Note that you have to turn 3G/Edge on in your iPhone otherwise it'll complain Safari not connected to Internet.
alk said...
eugen asked...
How to install OpenSSH on iphone without any network and wifi?
See my reply here
***************************************if thats possible then how to install BSD Subsystem, Community Sources and Mobile terminal on iphone without any network and wifi? Could you please provide a link if its possible to download just like the openssh?
Ralph asked...
but how does it work with an apple mac computer?
It doesn't. See solution for mac here
Hi,
Thanks for your guide. I tried this on FW 2.2.1 and have one problem.
1) I can only make this work when the APN settings are correct. BossPrefs show the APN IP address but www.whatismyip.com shows the PC address (which is good at least partially).
2) On the other hand, when I type the wrong APN settings, I cannot connect to internet on the iphone.
Are you sure I won't be charged for the data transfer in the first case?
Hi nice post chap ! I have a query, can we use Tunnelier so as to run torrents? I mean I access the internet through a proxy server (LAN) and the firewall/router blocks all the torrents. Can we use tunnelling as a solution to overcome this problem?? If yes what should we set the settings to in tunnelier??
Hi Alk, greetings from Rio!@# GOOD JOB
I have a iPhone 2G fw 2.2.1,i have done all your process but i still face some problems. BossPrefs is fine, the EdgeProxy toggle button is there, all fine. I run the Tunnel, open the software to surf over the phones files but when i try to connect (apps, safari, mail , weather) the connections uses my GPRS account and it is slow and very expensive.
I wonder if this tutorial works with iPhone 2G FW 2.2.1.
Any one knows?
pS: The reason I want to hat to work is because my WIFI works sometimes, sometimes not.... Im sure its a hardware problem, bad contact maybe cuz it works sometimes....
PLEASE HELP.
R
Hi ALK,
Now I get the windows error 10061 at Bitvise, everytime that an app or safari try to reach the network i get this message.
I can see now some results, i feel close to achieve the goal.
Is there any way you could help me to setup that?
Ralph asked...
but how does it work with an apple mac computer?
It doesn't. See solution for mac here
I think this link is not exactly the same. It just shows you hot to access you iPhone via SSH and do tethering but I could not figure out how to access the internet via USB cable using the the Mac's internet connection.
I use 2.2 on iPhone 2G and after turning off EdgeProxy in BossPref I cannot get the iPhone work via regular EDGE network. Any ideas?
Here is what I did:
turn off EdgeProxy in BossPref
replace /private/var/preferences/SystemConfiguration/preferences.plist
with the original one, make sure (although not necessary) that proxy.pac says:
function FindProxyForURL(url, host) {
return "DIRECT";
}
How can I make EDGE work again?
Thanks a lot!
I have updated the original post with info about fw 2.2 use (yes, it works).
Moreover, you don't need to switch off the proxy anymore to enable EDGE connection, it will be auto-chosen if you disconnect the USB-cable.
Thank you very much, good job. I should also say that this works well on my iphone 2g 2.2.1 firmware
Is there a way to not start using the edge network if the usb connection is lost because if i erase the apn settings i cant connect to the internet via usb
i did everything ( maybe correctly ) and i get this massage in tunnelier :
"
connected
Starting first key exchanging
Server disconnected without sending a disconnect message.
"
how can i help this?
i'm on xp firmware 2.2.1
In addition to my earlier post, since you have mentioned that in the latest firmware versions it is not required to enable/disable the edge proxy i.e. if the cable connection is not available the iphone will start using the edge from GSM service provider.
So is there any simpler way of configuring the USB connection i.e. without BossPref and writing info to Proxy.pac ?
Thanks Alk for all that research and making things easy for other people!!!
I have jailbroke iphone 2.2 and i was able to successfully connect to internet as per your instructions above. It works very well with the Safari browser, i.e. i could see logs to each request in the Tunnelier, however when i try to start GMaps, Stocks, Weather, Cydia, Installer or appstore i dont see the logs in the tunnelier, but it does get connected. Does that mean that it used my EDGE? how do i get these apps to connect thru LAN internet? Any help on this one?
Thanks Alk for your help but im experiencing a problem.
I have a 3g on 2.1 (with bossprefs v. 2.15) with a working edge connection. The procedure went perfectly as far as i can tell. The iphone restarted and all and the files were created. But when i tried to connect over safari it just connected over edge and i was charged.
In addition there were no requests logged in tunnelier. What should i do?
I have a problem, the ssh forwarding is working, i can do telnet localhost 8118, and i see my incoming connection on my PC into the proxy. But it seem that Safari don't know that it need to go to port 8118? I think the error is in the preferences.plist. Is there a working example for firmware 2.2.1 that i can look?
I'm using 2g fw 2.2.1 and it works for me. but when I type the wrong apn it won't work?? I'm afraid about this matter. Can anyone tell me why??
Ok I have got the answer to my first question.
Anyhow I have contacted my mobile srvice provider about the edge settings for my 3g and all that they told me is the APN and nothing else i.e. APN is ufone.pinternetbut that did not help, imean internet does not work. The rep at my mobile srvice provider told me that if there are any ip address or proxy settings, just leave them blank as htese are not required.
Can anyone guide me what seetings are necessary to make internet work on my iphone 3g.
Hi Alk greatt work man...
but i have 1 problem...when i use USB to get online the speed is fast(which indicates that its using my system's broadband connection) but i'm still charged for the EDGE usage by my service provider :-(
No one answer my question, is there a working example of preferences.plist for firmware 2.2.1 like my iPhone 3G?
hey can u help with my ipod touch anyone, cani follow these steps
Can I use same procedure with my Ipod Touch to use internet via usb cable.
plz email ur answers on my below email.
adnansilat@seatradegroup.com
Umar said...any simpler way of configuring the USB connection without BossPref and writing info to Proxy.pac?Yes, you don't need Bossprefs anymore but proxy.pac should be created once and for all.
Benoit said...but it seems that Safari don't know that it need to go to port 8118? I think the error is in the preferences.plist.Safari should not "know" that it needs to be connected over any proxy. This is a magic of ssh-tunneling. Add proxy section in preferences.plist properly, create proxy.pac in the iphone and check privoxy log to be sure it works.
Adnan said...Can I use same procedure with my Ipod Touch to use internet via usb cableNo, it doesn't applicable to ipod touch, because of its lack of gprs/edge module.
Please be absolutely sure that your carrier's edge/gprs/3g settings are OK and iphone works with them before implementing this guide. Don't worry, if you see the connection in privoxy log it is certainly over USB, so free of your carrier's charge.
Hi alk
I tried this on iPhone 3G firmware 3.0 and its not working. The connection is still going through 3G as the ipaddress using http://2ip.ru are different on iphone and PC.
I also tried http://127.0.0.1:8118 on the iPhone and its display "Invalid header received from client"
Does this work on firmware 3.0?
Pankaj said...
I also tried http://127.0.0.1:8118 on the iPhone
You certainly shouldn't! Is it not mentioned anywhere in my manual?
Please check your preferences.plist file and be sure to select the proper section for proxy file in it.
No one answered my question :-(
when i use USB to get online the speed is fast(which indicates that its using my system's broadband connection) but i'm still charged for the EDGE usage by my service provider :-(
abhishek said...
when i use USB to get online the speed is fast but i'm still charged for the EDGE usage by my service provider.
Please clarify the details from your ISP on what kind of EDGE data you charged for and when. Compare with your actual online activity using privoxy log, for instance.
Every time you are online check the ip-address you've got (2ip.ru), be sure it's not from your ISP EDGE pool.
If still in doubt send me email.
Hi Alk
Please ignore my previous post. Itr worked on my iPhone 3.0.
For others, please ensure that you add the proxy keys at the right place in the preferences.list file. There are many places the same sort of entries occurs hence search for word ip1. In my file, it was inserted at line number 169. I was previously adding this at line 22 which is for devivename ip3 and not for devicename ip1.
Alk, one more question. At my work we have a proxy server for all browser based traffic. This is achived by using "Detect automatic proxy server" in the IE. Using your method the iPhone does not go through the proxy server. Is there a way to configure Privoxy to go through the proxy server.
Pankaj said...
At my work we have a proxy server for all browser based traffic. Is there a way to configure Privoxy to go through the proxy server?
Yes, if you know the address and port of your work proxy you can configure Privoxy forwarding to parent HTTP proxy (see its config.txt section 5.1)
But instead you can tune up the Tunnelier S2C directly to corporate proxy as I described in my manual.
See my example for proxy server address 192.168.0.10 and port 3128.
Thanks a lot alk. I set the proxy in the forwarding settings and it worked like a charm.
Now all my safari, cydia and app store traffic is routed through to Privoxy to my corporate proxy to the outside world.
However the GMail traffic is still going through 3G/Edge and not through the Privoxy. The Gmail is set through the mail account in iPhone 3.0. How to I redirect GMail through to Privoxy?
Pankaj said...
However the GMail traffic is still going through 3G/Edge and not through the Privoxy. How to I redirect GMail through to Privoxy?
Privoxy won't help for smtp/imap/pop3 mail connection. Please, read carefully my post, at the bottom I explain how to tunnel email exactly for gmail.com.
Okay I understand that, but does this mean that every time I connect my iPhone to the internet via my laptop I need to change the mail account settings (the host name from imap.gmail.com and smtp.gmail.com to 127.0.0.1) and then change back.
is there some automated script that I can use through BossPrefs that can alter my mail settings
Pankaj said...
...is there some automated script that I can use through BossPrefs that can alter my mail settings?
You can prepare two instances of /etc/hosts file in iphone.
Copy existing hosts to hosts.off and hosts.usb, add to hosts.usb extra two lines:
127.0.0.1 imap.gmail.com
127.0.0.1 smtp.gmail.com
What you need is to copy /etc/hosts.usb to /etc/hosts when you are connected via usb. On disconnect copy /etc/hosts.off to /etc/hosts back. You can even prepare your own Bossprefs toggle for this purposes, see my edgeproxy.zip and scripts.zip examples.
Alk Said ...
You can prepare two instances of /etc/hosts file in iphone.
Copy existing hosts to hosts.off and hosts.usb, add to hosts.usb extra two lines:
127.0.0.1 imap.gmail.com
127.0.0.1 smtp.gmail.com
What you need is to copy /etc/hosts.usb to /etc/hosts when you are connected via usb. On disconnect copy /etc/hosts.off to /etc/hosts back. You can even prepare your own Bossprefs toggle for this purposes, see my edgeproxy.zip and scripts.zip examples.
Thanks it worked. I finally created a file called EdgeProxy with following script and copied it into /private/var/stash/Applications.pwn/BossPrefs.app/services.
echo -e "## START - ADDED BY PJAIN FOR EDGE PROXY ##\n127.0.0.1 imap.gmail.com\n127.0.0.1 smtp.gmail.com\n## END - ADDED BY PJAIN FOR EDGE PROXY ##" >> /etc/hosts && echo "1" > /private/var/preferences/proxy.pid
grep -i -v "ADDED BY PJAIN FOR EDGE PROXY" /etc/hosts | grep -i -v "127.0.0.1 imap.gmail.com" | grep -i -v "127.0.0.1 smtp.gmail.com" > /etc/hosts.tmp && cp /etc/hosts.tmp /etc/hosts && rm /etc/hosts.tmp && rm /private/var/preferences/proxy.pid
exist /private/var/preferences/proxy.pid
/Applications/BossPrefs.app/edge.png
The above code adds/removes the suggested two lines to/from the /etc/hosts file. Hence by using the BossPref I can redirect the smtp and imap traffic for gmail by using the EdgeProxy icon.
Just one more question. For some reason the WI-FI in BrosPref is not working. Switchinh on and off the WIFI from there has no effect on the actual WIFI. Is there a way, I can add the WIFI switch on/off to my above script
I confirm that, It works exactly right on iphone 2g with firmware 3.0 installed. This is really great post by alk. Good job keep posting more of this.
However, I need a favour from you mr.alk . I'm using EVDO for connecting to the internet. I would like to download some content from the rapidshare website. But could not do it due to the EVDO connection technology. EVOD shares the same ip with different users. Could you please help me in getting rid of this. Would be really great full to you. Thanks in advance for any help.
Regards,
Kasim
does this work on i-pod touch with OS ver 3.0(7A341)?
i was trying to modify the preferences.plist and couldn't locate the codes in the file where i need to put in the new codes
in the comments pankaj says to look for ip1 which i couldn't find in the file.
any help for ipod touch users?
guys i am not able to save preferences.plist in iphone 2G 3.0 software? any idea?
i can save it but after rebooting the iphone it is back to where i started the code i inserted is not there, i have managed to solve this on the 2.1 and 2.2 but not saving on the 3.0 any idea what i'm missing?
is it the same for iphone 3gs? I added the changes to the preference list and the pac file as well... But still Safari could not use the proxy... (openssh and 3G/EDGE enabled)
Anyway I think the idea is really cool...
Greets,
patro02
I get the following error on the RunTunnel.cmd when i try to login Tunnelier:
new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 1
AMDeviceValidatePairing = 0
AMDeviceStartSession = 0
MobileDevice: _connect_to_port: Could not connect to USB mux port 1472 for devic
e 7: Unknown error
MobileDevice: AMDeviceStartServiceWithOptions: Could not connect to "com.apple.
afc" service on port 49157.
AMDeviceStartService = -402653083
AFCConnectionOpen = 0
Any ideas alk? congratulations on the tutorial. I appreciate your dedication.
It doesnt work on me
im using iPhone 3.1 2G (EDGE)
Itunes 9
Can anyone confirm it isnt working on 3.1 or iTunes 9
hello.. i am lucky to find this post but it will be awesome if you can do a youtube video on this.. this is very complicated for me... so can you make a video?
Great, looks like it works - thanks for posting all those months ago (I had to completely uninstall itunes 9, along with Quicktime and pretty much anything Apple, but with itunes 8 it works fine.
But iPhone never succeeded to send request to Privoxy (no any request information on the debug window). But when I set Firefox on PC to use 127.0.0.1:8118, Privoxy did received bunches of request, shown on the debug window.
My Blog : earn money chao!
Great, thanks!
But some applications didn't go through this solution. E.g. films from YouTube, any network speedtests, net radio stream (what give me pain), etc.
Can you give a solution (probably any other settings in preferences.plist only) to force YouTube and others through this method?
Hei, I got iphone 3g 3.0.1 and following your guide I made my email work.
Unfortunately no other application can connect to internet.
My phone is locked (due to baseband upgrade) and wifi is also broken (due to 3.1.2 upgrade).
Is there any chance to make Safari and other applications connect to internet through my pc?
Thanks.
Works well w/ blackra1nd 312 FU but not YouTube nor push-enabled apps. THX.
what the h@ck do you mean when you say To change its config choose Options/Edit main configuration, privoxy will open it config.txt, find section 3.1 debug and uncheck this part in it:
debug 1 # log each request destination (and the crunch reason if Privoxy intercepted the request)
debug 4096 # Startup banner and warnings
debug 8192 # Non-fatal errors
deleting it?
Will this work on iphone 3gs 3.0.1 / 3.1.2? I tried this on my iphone 3gs with 3.0.1 but the ip I am getting is still from the gprs network. I am not getting any requests getting to the tunnelier. I had placed the preferences.plist and pac file in the iphone through ssh as well.
Please help.
I have create proxy.pac file and uploaded it under root. But it gives out error as no cellaur data avail on this pone.
I confirm this works on iPhone 3G firmware v3.1.2. Thanks to alk!
Some notes:
- preferences.plist: must add in Proxies of ip1 interface (need to restart iPhone after copying preferences.plist and proxy.pac)
- Must turn on EDGE on iPhone (I use SBSettings to toggle). And GPRS APN must be configured correctly on Settings > General > Network > Cellular Data Network
- If everything works, should see some texts like 'Received client-side server-2-client connection from 127.0.0.1' flying in Bitvise Tunnelier
alk dude nice work not only u wrote such an amazing process but u are also replying to the comments appreciate that.I wanna donate and make your site bigger if you want to.Add me on therocksaysthat@hotmail.com
nguyenchitam can u u give me ur id..I cany make it work on 3.1.2 firmware..
nguyenchitam can u u give me ur id..I cany make it work on 3.1.2 firmware..
hi can you please update with 3.1.2 i cant get it to work... great work btw!!
For all of you who can't get it to work, try changing the permissions of *.pac to 777. Safari runs as the mobile account, and doesn't have access to the file.
My Iphone is working sort of . I did everything but it's only work when my phone finds the celphone network. I don't know if I did something wrong but it works perfect if I have connection or if shows in my iphone the 3g. It won't use the 3g cause I see in the privoxy the requests but the iphone need to see the 3g.
Could someone help me with this issue?
Thank a ton
Reverse Tethering iPhone 3G/3Gs using USB
Step 1: Set up internet tethering on your iPhone.
Step 2: Plug you iPhone into your PC using the provided USB cable.
Step 3: Go to Settings>General>Network>Internet Tethering and switch it to "On." Then it will prompt you for bluetooth or USB, select USB
Step 4: Go to network connections and you should see your LAN connection and a new connection that says "Apple Mobile Device Ethernet." Simply highlight both connections, right click on one and select "Bridge."
You will now be using your PC's internet connection on your iPhone! It works for Cydia App store, Facebook, Safari, ect ect.
Note: After terminating the connection you must delete the bridge and make a new one when you re-connect.
Brow.. .Unfortunately, it didn't work, did you tried it before?
First jailbreak your phone and install internet tethering that enables you to tether through usb. Connect your iphone to your pc via usb and turn it on. You will see a network connection appear. Bridge that network with your current internet network. Your network has to be wired through lan. With wireless its different.
I know, it works but MY IPHONE NEED TO HAVE A INTERNET CONNECTION in order to show up in my computer ''CONNECTED'' the ''APPLE MOBILE DEVICE ETHERNET'' won't show as ''connected'' if you are not connect to the internet (in my case, 3g) if put the Iphone in airplane mode it won't connect either.
Any Idea?
I have the same problem. I use an ipod touch 3.1.2 and do have this in the preference.plist file.
DeviceName
ip1
Hardware
com.apple.CommCenter
Type
com.apple.CommCenter
Please help
This is just what I was looking for. Does it also work for iPad?
I have a Wifi-only iPad and I don't have Wifi at home. Can I use my PC's broadband Internet connection for my iPad's use?
Many Thanks.
My friend, I wish I had that answer. Unfortunately no good soul give us an advise and to be honest, I don't really that tutorial works.
person with the ipad what version of windows are you using (vista, xp, 7)
and do you have a wireless card if ur on xp and i think vista you can make ur computer a wifi hotspot.
Thanks P for the suggestion:
However I can't use wifi not because I don't have a wireless router but because I am hyper sensitive to EM waves.
Those 2.4GHz radio waves are killing me if I turned on my wifi router. I have tried and it caused me headache an chest pain.
The only way I can get to Internet is through wired cable, either USB or CAT5.
Thanks your suggestion anyway, I am still trying to find solutions.
Have a wonderful day!
Taiwu
I just followed the tutorial for my iPhone 2G running 3.1.3
It works great except for Runtunnel command had to be running from the beginning in order to connect with Tunnelier to connect to the phone and do the file modification/uploads.
Nevertheless this is great, as the WiFi on my iPhone stopped working about 8 months ago.
Thanks for this tutorial.
Please, I did followed the tutorial.. it is really a mess.. :'(
too many steps that are not included for the 3.1.2 firmware
I tried to apply these for my iphone 3G 3.1.2
everything seems alright, except for the EdgeFix file I don't know what to do, u said I have to ignore it in the orange font..
Please can you modify the steps, for us? please?
My wifi is dead.. so I'm out of luck just waiting you to modify the steps and make them more clear + removing the old parts of it.
Please mate, this is really necessarily you'll help a lot out there looking for the same information.
Thanks in advance
I had the same problem as well, I tried everything, the closest I got was making the iphone 3g getting the internet through usb ONLY if I had 3g activated .
@ Destruckt:
So you mean iphone should connect to the internet in 3G? so why using USB!
no, the whole thing of iptunnel and tunnelierportable.exe and privoxy works fine IF you see the symbol of 3g or 3dge, which is weird. you would use the proxy for sure, cause you can see it connecting THROUGH usb. But it will only work IF you have the cellphone carrier connected. I know that for sure cause were I work is a bullet proof environment (yes, thick windows/walls agains big guns) and I dont have cellphone connections at all. But when I go home where I can get connections the usb works.
Now, if I try to remove the simcard or even put in airplane mode, it will not work and AS I SAID in my work it will not work either and I know that's not the pc cause I use the same laptop at home and at work.
Well, guys. I clearly explained before that it is really important to have Gprs/Edge/3g interface up and running in the iphone in order to succeed with this guide.
Imagine that you have a PC with two network cards, one is "called" wi-fi, another is edge/3g. So you must have them being installed in the PC physically to proceed with proxy tricks. You won't use them logically, no traffic to be sent but they must be enabled to proceed with USB.
So any ipod touch, ipads without 3g etc. are out of scope because they lack the "second network card interface".
The most important part of the manual is to correctly modify preferences.plist file in your iphone.
If you still have problems apply me email message with details.
so, ALK, there is no way we can '' trick'' the iphone to Think it's connect the internet? That would be apply to not only Iphone, but itouch and ipad.
And, yes, I notice that when I'm using your trick it work through the USB not the CELL DATA!
there is no way we can '' trick'' the iphone to Think it's connect the internet?
What do you mean?
It is iphone and only iphone CAN be tricked to think it's online because we use proxy redirect from its edge/3g (ip1) network interface.
ipod touch (ipad w/o 3g) doesn't have this interface - so there is no way to proxy it over USB.
octav, you don't need to use bossprefs, toggles, signals etc. with OS3.x
The only important thing is to have properly modified preferences.plist, keep one proxy.pac with PROXY statement. No need to switch back to DIRECT. The iphone itself will choose egde/gprs connection if the cable connection is not available.
thank you , alk. sorry for deleting the posts, , I know that your blog it's not a chat ,it's just that I kept finding spelling mistakes , or files that I said I couldn't find. I' m having some problems convincing my phone not to modify preference.plist , every time it reboots. After reboot , itunnel.exe crashes , and when I start over again , I find the same old preference.plist , which I change it again , save it, an so on . I'll find eventually a solution . Thanks again for the great post ! You've done a great job ! And thanks for answering to people asking for help. I really appreciate it .
Hello, my iphone 3g, 3.1.2 wifi is broken. and icant see no wifi networks.
will this work with that. oh another thing is that here where i live there is no 3g speeds.
Hey alk.. I got a funny question here.. I have an iPod Touch 3g and i know u said it cant work on the touch coz it u need an internet connection on the computer and on the iphone even though u wont be using the internet connection on the iphone..
So lets say the internet connection i have on my touch is the wifi.. can it be done? I mean i have wifi in my area but even a snail can beat google on my touch..
So here is my question.. If i were to connect my touch to the slow wifi and my laptop to the fast lan cable.. Could i possibly go through your process and end up a success? Even if u dont know the answer, could you at least give me your best guess before i give it a try?
THANKS~!
Buff-A-Licious..!! said...
So here is my question.. If i were to connect my touch to the slow wifi and my laptop to the fast lan cable.. Could i possibly go through your process and end up a success?
I would recommend to arrange point-to-point (ad-hoc) wifi connection between your laptop and your touch. So use wifi instead of USB cable, apply the manual accordingly, i.e. connect ssh-client (laptop) to ssh-server (touch) directly, by ip-address, without itunnel. If you have questions drop me email to alk@inbox.ru
alk does this method is not working on my 3gs 3.1.3
does this work with ipod touch?
I have to repeat again. The above doesn't work on ipod touch because it lacks the radio (gsm/gprs/egde/3g) module.
Hi, awesome tutorial, and eventually i got it to work. I have my computers internet through my phone now through usb =] ty.
But i have one question. Im trying to send the USB connection out through MyWi, but it keeps sending out the edge signal instead of he USB. Is there a way to get this working?
Please Please Please!!! Help me, this would be amazing to get to work. Ty!
I don't know what is your email but would it work on iPhone 4 OS 4.0.1? Thanks!
Am I understanding this correctly, that if I don't have cell phone service this will fail for me?
I really want to do this because my place of work doesn't care if I use my iPhone but there is no wifi, yet I have access to USB and Ethernet.
alk just stopping in to say thanks for all your research on this subject
My wifi went grey about a wk ago and i am now happy to say that i am 'reverse tethering' on my iphone 3g on ios 4.0
Many thanks!!
Great post finally got online this way, with a lot of dabbling, i think the guide could have been made a bit shorter.
Working iPhone 4 ios 4.0.1
Ok so now thats complete, how can i use the tunnel for internet enabled apps?
How can i find the outgoing port an app uses?
I use iphone 2g wid firmware 3.1.2
please help me out to connect my PC internet to iphone through USB
This is excellent - thanks alk for your posting and sharing. Got it working on firmware 2.2 via laptop on XP. Note that you have to turn 3G/Edge on in your iPhone otherwise it'll complain Safari not connected to Internet. Online Surveys
it so fantastic. so helpfull.
thanks you to your article.
ps. can i copy this article to my blog? my post will digested and corean translated. plz, replay.
Alk good work
how about a small youtube video on this? many are searching for this and you can be a great help.
Also are these steps valid now for itune 10? would you like to update this tutorial for newer phones
Regards
Aditya
so fkin smart.... tutorial on how to get internet via usb then he says you need to download via wifi -_- why do you even think i want usb internet?
Brilliant! I never thought this could work.. Though for a change, I used IP Elk to check my ip. I'm tired of the typical IP checking sites and want something better, and newer.
Regards,
Jevim
i am totally counting for a youtube video. But i want to know, will it work on ios 4.3.3 3GS...?
well written tutorial... I know its over 3 years old now... Any thought to why I might be getting the following error when trying to connect from the Tunnelier client:
"Server disconnected without sending a disconnect message."
Works on iOS 4.3.3 on iPhone 3GS and iPhone4. it should work on iPad 3G models too I'll need a guinea pig to try it out on.
Minor Changes..
Instead of iTunnel...Use iFunBox's USB Tunnel Section.
www.i-funbox.com
In Tunnelier: Set the Host to the IP address of the local PC
(USB Tunnel Section in iFunBox Shows Local IP).
On S2CForwarding section...tick Accept server-side port forwardings.
Login with Tunnelier and open Privoxy.
and you're done.
Test by going to http://2ip.ru on both PC and safari on iDevice. If the IP is the same on both its working for you too.
Oh Make sure WIFI and 3G are off but EDGE is on.
Need Help...Talk to me on Palringo in group debitosphere. Download Palringo in the appstore.
does this work for firmware 4.1 on 3gs
Should work on every firmware up to iOS 4.3.5. I have not tested it on iOS 5 yet.
@alk
My Mail Works but not h Internet
iPhone 3G 4.2.1
plz update to make it work with IOS 5.0.1
I did all what you said.
but I'm getting the message no connection could be made because the target machine actively refused it.
itunnel9 is closing by it self right away, maybe this the cause but I don't know how to fix it.
no need to say that you did a Great job thank you for this wonderful post.
please help me with this
Alk.. i tried on my iphone 4 iOS 5.1.1 and did every step of your. But my phone is still using edge services instead of internet for PC. Is that anything to do with APN setting as i have used apn.unlockit.nz for APN for my service provider.
I have tested it on iPad 2 Wifi and 3G models.
The 3G model works perfectly using the instructions I've posted previously with firmware 5.1.1
The Wifi only version works, however you must be connected to a wifi network (doesnt need to have internet access on the wifi) and manually specify 127.0.0.1:8118 as your proxy in the wifi settings for your current connection on your idevice.
This option isnt good if youre Wifi isnt working but if your PC is directly connected to the modem via ethernet cable, your latency drops and may get a speed increase when playing games etc.
it may take a few attempts to get your iPhone into DFU mode. Generally, I hold down both buttons then release the Home button just before I think the Apple logo would appear. If you are still holding both buttons down and you see the Apple logo you are holding them down for too long iphone 3gs jailbreaking help
will this work on ipod touch running 5.1.1?
Yes it does work on any iPod Touch jailbroken on 5.1.1 provided you follow the instructions I posted earlier regarding specifying the manual proxy in your wifi settings.
Do you think it would be possible to set up VPN via some variation of this method? I've tried briefly but I can't seem to get the tunneling to work right yet. Seems to me if you went this way you could have easy access to the entire network over the USB cable without having to explicitly set up port tunnels for each service you're looking to forward. Something like whats outlined here: https://help.ubuntu.com/community/SSH_VPN
Thanks @alk, but when i hit login this message comes up;
"Connection failed. connect() failed: windows error 10061: no connection could be made because the target machine actively refused it."
one think that i use this in office.
thanks
whatsmyip.org is not working, its down now.
try https://iplocation.io
Post a Comment