Monday, February 27, 2012

Create a VPN tunnel using your iPhone/iPod and your Windows 7 PC

Have you ever wanted to access network resources on your home network with your iPhone/iPod? I am going to show you how to setup a simple PPTP VPN tunnel on your Windows 7 machine and then connect to it using your iPhone or iPod.

First, we need to setup the VPN server. On your Windows 7 machine, go into your Control Panel and then open up Network and Sharing Center. Now click on Change adapter settings.


















Now if your Menu is not visible like below, click Alt and your menu should appear. Click on File...New Incoming Connection...






















Now you'll be given a list of users that are on your Windows 7 machine. Choose the user that you will use to login to the VPN connection. I'll be using mick for this example.



















On the next page, ensure that Through the Internet is checked.



















On the next page, check all the boxes as seen below.



















Click on Allow Access. Your Windows 7 machine should now be listening for VPN connections on port 1723. We can check that by opening up the Command Prompt and typing in netstat -a













So our VPN server is now listening for connections. We are not done yet, on your router you will need to forward port 1723 to the IP address of the machine you just set this connection up on. To get your IP address on your Windows 7 machine, open up the Command Prompt and type in ipconfig /all. Take note of the following options:

IPv4 Address...
Subnet Mask...
Default Gateway...
DNS Servers...

We are now going to set your computer up with a Static IP Address if you have not already done so.

Like before, go into the Control Panel and click on Network and Sharing Center. Then, click on Change Adapter Settings. Right click on Local Area Connection and choose Properties. Now select Internet Protocol Version 4 (TCP/IPv4) and click on Properties.


Enter in the information you took note of when using ipconfig /all.

Click Ok and open up the command prompt to make sure you can still access the internet. Type in ping google.com You should see a message that looks similar to the image below.












Now that we have a static IP address set up, we can set up Port Forwarding on the router. I am using a Linksys WRT54G router for this example.

Log into your router and find the Port Forwarding option menu. Your menu may look a little different then the one I am using but it is still the same principal. We want to forward all requests for port 1723 to the Windows 7 machine we set up the VPN connection on. Use the static IP address that you assigned your computer.





















Now to connect to our VPN server, we need to know our public IP address. You can find that out by going to whatismy.com, ipchicken.com or just using google. Since your public IP Address is probably dynamic (meaning that it may change on occasion) I would suggest setting up your computer with a DynDns account. This site allows you to assign a DNS name (e.g. yourname.dyndns.org) for free and when your public IP Address changes, the software updates your DNS name with the new IP address.

Now that we have our port forwarding setup, let's set up our devices to connect to our new VPN tunnel.

iPhone/iPod Setup

Click on Settings


























Click on General































Click on Network


























Scroll down and click on VPN


























Click on Add VPN Configuration...



























Fill in the fields with your information. Ensure that PPTP is selected and Send All Traffic is off.


























After you have entered all of your information, click on Save. Then try out the VPN connection, your screen should look like this if everything was setup properly.

19 comments:

  1. Great guide, thanks.

    However - I've tried the above but I get connecting, then starting, then it seems to time out - the iphone responds saying "You were disconnected by the communication device. Try reconnecting. If the problem continues, verify your settings."

    Any ideas?

    ReplyDelete
  2. Since it's not giving you an authentication error, it sounds as if your iPhone is not making it all the way to your computer that has the VPN connection set up on it. Double check that you have the port forwarding setup correctly. Also, you'll run into issues with this if you have a modem that acts as a router. Your best bet for that would be to put that modem/router into bridge mode.

    ReplyDelete
  3. Have you ever wanted to access network resources on your home network with your iPhone

    ReplyDelete
  4. How do I access the resources (shared folders of windows 7) when I connect to VPN?

    ReplyDelete
  5. Thanks for the guide. However, I followed it religiously but when I try to connect from my iPhone, it goes "Connecting... Starting... Authenticating... Disconnecting..." and then I get this error message: "A connection could not be established to the PPP server. Try reconnecting."
    If I enter intentionally a wrong password, the system prompts me for the right one, which I guess means I make it to the Windows 7 PC properly. Any advice? Thanks.

    ReplyDelete
    Replies
    1. I had the same issue. Make sure you right click on the Incoming connections, Properties of IPv4 and choose specify a range of IPs instead of assign one. That fixed my issue.

      Delete
    2. Also, if you are connected to the network via wifi on your phone, you're likely going to have an ip conflict which will keep you from connecting to the VPN. You'll have to connect from another internet source such as regular data plan connection on your phone.

      Delete
  6. I followed everything, and the VPN appears to work for about 30 seconds. If I am looking at my PC when I connect, I can even see that it is reporting my account as an incoming connection. As I said though, after about 30 seconds, the iOS device seems to get booted from the connection.

    I have quickly checked, and I can use the VPN connection from the iOS device to browse the internet, but as soon as (as described above) the Win7 computer shows the account being disconnected, I lose the ability to browse the internet until I get a message that the connection has been lost, or I turn VPN off.

    Any thoughts?

    ReplyDelete
  7. Could you please clarify the 'Account' and 'Password' required in the iPhone VPN settings. Is this the My user name on my PC and the password required when I log on to my PC? or is it something associated with the VPN setup in the router? Whatever Account an password I put, I either get a box asking for my username and password, suggesting that they may be incorrect.
    My router (a Draytek Vigor 2600) has facilities within it for setting up a VPN. However, as you only mention port forwarding of port 1723 I have done only that and disabled all the dialogs on VPN setup. Is this correct?

    ReplyDelete
  8. The port forwarding doesn't see, to work. If I have I'm on the same network and I type in my VPN's IP4 address it works but not if I use the external IP. I have it forwarding to my VPN's IP4 and if I do external it doesn't work.

    ReplyDelete
  9. Good manual for VPN tunnel creation.
    top10-bestvpn.com

    ReplyDelete
  10. Thank you.Cool solution for VPN tunnel on Iphone/Ipad.Connection works cool.
    http://10webhostingservice.com/

    ReplyDelete
  11. The surround sound system that ties into your consumer electronics that you have, or may need to have installed, you need a world class expert to show you the proven strategies that will eliminate the headaches and heart aches most homeowners go through.
    wireless network

    ReplyDelete
  12. Do you have facing linksys router problems Get quick and complete Linksys Router Help at visit- Linksys Router Technical Support also call Toll Free No 1-800-231-4635 For US/CA.

    ReplyDelete
  13. Wow, it seems like an easy option to enable VPN for Windows PC. I am sure a lot of people have taken the advantage of it. Anyways, I am already using the HMA VPN and trust me it is the best paid service. You can find detailed hidemyass pro vpn review online.

    ReplyDelete
  14. The benefits of the private network of the best US VPN service include management policies, functionality and securities. VPN service

    ReplyDelete
  15. Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists.
    https://bestcheapvpn.com/

    ReplyDelete
  16. Great tips! With NordVPN, you can protect your IP address and your internet activity from your ISP so that it is not passed to third parties, including advertisers or government.

    NordVPN offers military-grade encryption with a strict no logs policy along with a host of other features:

    P2P allowed
    Onion Over VPN
    Malware and cyber threat protection
    Blazing speeds
    Global network
    Kill Switch
    Unlimited bandwidth
    Double encryption
    Bitcoin accepted

    Plus you'll enjoy an uninterrupted streaming experience with no bandwidth throttling or buffering. Just download the app and click the 'on' button to get instant protection.

    Join now at one of the lowest prices for yearly subscriptions in the industry:

    http://clickmeterlink.com/nordvpn1

    ReplyDelete
  17. Try FastestVPN on your iOS devices (iPhone and iPad) vpn for ios.

    ReplyDelete