Thursday, February 21, 2008

How to share internet connection on PC with iphone

This is a tutorial on how to share the internet connection available on your ethernet port(LAN cable) or dial-up connection with your iphone, if you have a wireless network adapter in your PC/Laptop. This will be helpful for the people who do not have wireless modems in their home, but have other means of connecting to the internet like broadband, dial-up etc. However, the PC need to have wireless adapter which support 802.11 adhoc networking protocol. Most of today's network adapters support this. You can buy a USB based wireless network adapter which are widely available. This tutorial can also be used just to setup an adhoc network between a PC and the iphone. Enough of marketing, lets get started...

I am assuming that you are using windows XP or Vista. I am assuming that your ethernet is already configured properly for accessing internet. We first need to make your PC/laptop capable of talking to the iphone and viceversa. Follow the below steps to setup an adhoc network between the PC and the iphone.

1. Go to control panel -> network connections.
2. Right click on "Wireless network connection" and choose properties
3. Choose "Wireless Networks" tab.
4. Click the "Add" button, in "Preferred networks" section.
5. Give "iphone-net" as SSID (you can choose any other name)
6. Select "Open" for "network authentication"
7. Select "Disabled" for "data encryption"
8. Tick the checkbox saying "This is a computer-to-computer(ad hoc) network..."
9. You need not change anything else in the other two tabs.
10. Save your settings, by pressing OK in all the places.

If everything goes fine, in your iphone, you will be able to see "iphone-net" as one of the available wi-fi networks when you turn on the wi-fi in the iphone. Do not connect to it yet. The procedure ahead is very simple if you have DHCP available on your ethernet. i.e if you automatically get an IP when you connect the LAN cable. Most of the ADSL broadband modems have this functionality. They assign an IP to the PC, when the LAN cable is connected. If you are not a geek you mostly would use this feature to get an IP for your PC.

For now, let us assume that you have DHCP available on your ethernet, where you have internet connection. (If you do not have DHCP, you should follow some extra steps that I mentioned at the end of this tutorial). Follow the steps to create a network bridge.

1. You will have at-least have two entries in your network connections.
2. One will be of the ethernet, and another will be of the wireless network.
3. Select the two connections (by doing ctrl+left click).
4. While both the connections are selected, right click and select "bridge connections"
5. It will take a little while to bridge connections.
6. You will get one more entry in network connections with name "Network Bridge"

You are almost ready to go. Do your routine exercise whichever you follow to be able to access the internet on your PC. For e.g starting your ADSL modem, and/or connecting the LAN cable etc. Once you are able to access internet on your PC, do the following on your iphone.

1. Turn on the wifi
2. Select iphone-net that will be shown in the available networks.
3. Click the small blue round arrow on the right
4. It will give more details about the connection.
5. You should see the IP that is in the same range as that of your PC.
6. Open the safari browser, and open some website. It should work.
Enjoy!!

(I am bored now, I will write later on how to access internet if there is no DHCP on the ethernet. For the knowledgeable, its obvious that we need give static IP in both the PC and iphone in the same range. I will explain it later)

One big and irritating problem that I face is that, the network connection keeps dropping very frequently. It gets disconnected every 10 mins or so. The wifi signal indicator does not become grey, but internet access will cease. I do not know a permanent solution to this. If you know, please help me. The workaround is to turn-off the wifi and turn it on again.

See the following tutorial about network bridges for general idea. This network bridge is available only on windows XP and vista. This technique is very simple. I couldn't succeed to share the internet using the ICS(Internet connection sharing) feature. I did not try much. Also, I am not sure if we can create a bridge with a dail-up connection. I do not have first-hand experience but by quick googling it seems that it is possible.

52 comments:

J said...

Wonderful tutotial. I also tried internet connection sharing but it did not work. But i am waiting for you to add to your blog about the non dchp computers. I have a static IP which i use to get my computer work with the hardwire. So do u know what the extra steps are.

Boo said...

Hi sunil, I tried the same thing. it says " unable to join name". Please help me to connect to this. are there any firewall settings that we have to check if we are using the static IP.

REMiz said...

tx dude. it worked

Shane Tolmie said...

I tried it, with no luck. I'm thinking its because my WiFi card is already connected to a gateway with 802.11n. Perhaps I have to disconnect ...?

Sunil said...

Shane, you are right. If the wifi card is already connected to some other network, this solution will not work.

Sunil said...

If this tutorial does not help, one thing to check is the IP that you are getting. If it is something like 169.x.x.x, the most probably a firewall s installed on your PC, or at the DHCP server which is preventing the iphone to get into the main network.

If there is a firewall on your PC, try disabling it. If DHCP server itself is assigning this IP and you do not have control over it, then I guess you are unlucky.

Syamil said...

Turned off firewall and it worked like a charm. However is there a way around to make this work without turning off firewall?

Thanks

Sunil said...

Thanks for the firewall tip syamil.
Most firewalls have exception list. You may have an option to allow particular IP without any restrictions. You may want to try that.

hateeyes said...

hi, I just get all the steps in your tutorial, and get te connection, my iphone found the new net, but cant connect to the internet, I dont now why, I set the proxy parameters of the lan, but still dont work, any advise about this?.

Sunil said...

Hi hateeyes,

See if there is any firewall on the PC. This is a common problem.

hateeyes said...

hi sunil, the windows firewall is off. an proxy is configurated in my lan for the internet, I entered the data correctly but still dont internet in my iphone, must I try this in a lan without proxy?.

CrossOver Nepal Software said...

seems nice ..
but i need help with manual IPs.

http://www.crossovernepal.com

Anonymous said...

hey man when i ctrl + left click nothing...joshuacorbin@live.com

and im using some elses internet wireless...

Anonymous said...

Wonderful tutotial.
But i cannot see the network on my Iphone.
I checked the other tabs under Properties on iphone-net, and I found following warning under Authentication:
"IEEE 802.1x Authentication can not operate on peer to peer (ad hoc)networks or on networks for which data encryption is disabled"

I guess this is the reason that is bot working as a ad hoc?

I tried to make encruption (WEP) with out any sucsess.

Any idea?

Sunil said...

Did you try WPA also ?

Anonymous said...

Cool article as for me. I'd like to read more about that theme. Thnx for posting this info.
Sexy Lady
Escort service

kharun said...

Thanks for the post. It's really helping me out right now. Can you please write about the case without auto DHCP. I'm in a hotel that requires registration but I don't want to register all of my devices. It would be nice if I can make a hotspot around my laptop. Any ideas?

Alex said...

fantastic tutorial. now i can truly use internet where ever i want.

Evans said...

wonderful tutorial

Jimmy said...

keep these useful tutorials coming.

Sohrab Khan Personal Blog said...

this is what i was googling for "iphone internet sharing" coz i wanted 2 use my unlimited internet iphone package

Anonymous said...

Uhm, i got to Control Panel> Network and Internet Connections> but there is no Wireless Network Connection. Theres wireless network setup though..

Sunil said...

You are using the "category view" of the control panel. You can switch to "classic view" and go directly to "network connections".

Instead, in the "category view", go to control panel->network and internet connections->network connections. You will see your wireless network adapter there. follow from step-2 by right clicking on it.

Anonymous said...

Anyone figure how to stop the internet connection dropping constantly?

jeff said...

For those who have constant random dropping connection issues...

I've found a workaround which works quite well for me! My ad-hoc connection is holding solid!

From a DOS prompt issue the following command :

ping -t XXX.XXX.XXX.XXX

(change the Xs for the iPhone IP adress)

The workaround has been found at :

http://forum.eeeuser.com/viewtopic.php?pid=187544#p187544

Keeping on pinging the iPhone appears to prevent it from dropping the connection!

Try for yourself!

Unknown said...

Hi Sunil, I really, really want this to work for me. I have a question, when I get to the step that clicks the two connections and then right click and select Bridge Networks, I get 2 new connections, and 2 disappear, The 2 existing connections that I highlighted to bridge are my normal local Area Connection that uses my pc's ethernet card, AND my wireless connection that uses my internal wireless card. These 2 connections disappear from the Network Connections area labled "LAN or High-Speed Internet" and they both now reapear as 2 separate bridge connections, one for the ethernet card, and one for the wireless card. When this happens, it breaks my normal internet connection, and I cannot get it back unless I use the function "Remove from Bridge" function after right clicking the new Bridge Connection."

Any ideas what is going wrong? I hope you can help me, but thank you very much either way!

Sunil said...

Hi James,

It is natural that the 2 connections disappear from the Network Connections area labled "LAN or High-Speed Internet" and appear in the network bridge section.

After this, you said your internet connection is broken. Are you trying to access internet using your wireless adapter. If yes this tutorial might help you. Let me know if this works.
http://gadgetsandyou.blogspot.com/2010/04/fixing-169254xx-problem-with-network.html

Anonymous said...

Samil, I am trying to connect my iPhone to my pc via wifi and then use the wired Internet connection from that pc to give Internet access to my iPhone. Is that what your instructions are intended to do? Thanks! james

Sunil said...

Yes, your understanding is correct. This tutorial is to share the wired internet connection on PC with iphone over wireless.

Unknown said...

Samil, for some reason I cannot open the link you sent: http://gadgetsandyou.blogspot.com/2010/04/fixing-169254xx-problem-with-network.html

I have tried from 3 different pc's both with and without vpn. Does the link for you? Is there anyplace else, or any other way to get to it that you can think of?
Thanks!

jeff said...

I've found another workaround for the Wifi Ad Hoc connection intermittent dropping issue at

http://discussions.apple.com/message.jspa?messageID=9918969#9918969

"use airplane mode to disable the cellular data connection, then re-enable wifi"

jeff said...

The reason why you may have ad hoc coonection drop issue is apparently because the WiFi signal from an ad-hoc created on your computer is pretty weak, and when the signal drops below a certain point, the phone automatically switches back to the next best signal (in this case, 3G). If you go in airplane mode you won't see the problem.

http://forums.macrumors.com/showpost.php?p=9696187&postcount=2

Anonymous said...

thank you. ıt works fine for me too

Anonymous said...

Hi Sunil, I am unable to see the iphone-net network on my iphone. I have followed all your instructions and bridged the LAN and Wireless connections on my laptop as well. Could you tell what might be wrong here?

Thanks.

Sunil said...

Is the wifi on PC enabled ?
This is one thing that I did not explicitly mention in the tutorial.

Anonymous said...

Does anyone know how to do this using a dongle instead of a local connection? Can't bridge the dongle with the wireless.

Sunil said...

The dongle comes as a dail-up type in the list of network connections.
AFAIK, we cannot bridge dail-up and other networks.
So, in effect, you may not be able to use the above technique.

Please share with us if you find a workaround to this problem.

Anonymous said...

Check out http://www.connectify.me
Connectify utilizes your computers' built in Wi-Fi card to wirelessly share any available Internet connection: a cable modem, a cellular card, or even another Wi-Fi network.

iphone works well with windows 7 and it is free

Unknown said...

have turnoff all firewall but it still not work.

my iphone can see & connect to the adhoc Connection but the Safari & all other app can not connect to the internet

Mohamed Kandil said...

man ,am not gay ,but i love u !!

SoulSlayer said...

Man! This works like a charm! Thank you very much!

Faxir Gulee said...

just use (Gateway Laptop to Hotspot Converter 2.8) application for windows and you don't need anything else, your laptop will be converted to an access point for iPhone

iphone 5 said...

Thanks for sharing this. It is a good thing that iphones do exist and this site is helping people about the needs of their iphones. It's even cool that iphones are now upgrading and the latest will be out this year.

iPhone App Developer said...

I have a static IP which i use to get my computer work with the hardwire. So do u know what the extra steps are.

krissh said...

share your internet to mobile phone with mhotspot....

no need to install this software..

www.mhotspot.com

Unknown said...

Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u Internet Connection Setup Melbourne

iPhone Application said...

I am waiting for you to add to your blog about the non dchp computers.

dar said...

do i connect mu iphone via usb to do this?

justin mack said...

i love you

Ankur said...

just use a software called "connectify me"...thats all.

robadub said...

Thank you so much! I have been trying to find a way to tunnel internet connection to phone through USB without luck... making use of old USB dongle I had in drawer I followed your clear instuctions. Fantastic!!

Abdullah said...

Wonderful tutotial

it worked

i love you man

thank you