Damian Mehers' Blog Xamarin from Geneva, Switzerland.


How to: Windows 7 incoming VPN from Android

A couple of weeks ago I tried to get my HTC Incredible S, running Gingerbread to connect via VPN to my Windows 7 box.  I failed, but today I succeeded.  This is how.

I created the incoming VPN on Windows 7 by following instructions I found on the web:

Open the Network and Sharing Center


Click on Change Adapter Settings


Press Alt-F, and select New Incoming Connection


Configure the incoming connection


Change the IPV4 properties to specify a DHCP range

Make sure the range you specify is on your LAN, and out of the range served by your DHCP server (you can updated your DHCP server to exclude this range).


Check the firewall

I went to Advanced Settings under Windows Firewall, clicked on Inbound Rules, clicked on the Local Port column to sort by that column, and then verified that the line for port 1723 was set up and enabled (Routing and Remote Access (PPTP-In).


Set up port forwarding

I then went to my Router configuration, and set up port forwarding, so that external connections to port 1723 were forwarded to the machine I just configured (which is always allocated the same IP address by the router):


Now my Android device can connect to my internal VPN using the default settings.  You’ll need to know your external IP address.  You can find it using tools like http://www.whatismyip.com/ but it may change.  I have mine set up using http://www.dyndns.com/

Filed under: Android Leave a comment
Comments (24) Trackbacks (3)
  1. Wouldn’t it be simpler just to use a Remote Desktop client from your Android into your Win7 machine? That’s what I use on my Epic4G and it works pretty well; only problem is that it requires IP instead of machine name so I periodically have to look that up for it to work.

  2. Great guide!

    Dave, connecting to one box via RDP is definitely not the same thing as accessing an entire network via VPN.

  3. You can use a dynamic DNS service, such as dyndns.org, to automatically translate your changing public IP address to a hostname that stays the same (eg. samplename.dyndns.org). most routers have the ability to configure this service; just sign up for a free account, and enter the account info in the dynamic dns section of your router. Then you wont need to worry about checking to see if your ip address has changed.

  4. sorry, i just realized that dyndns.org is mentioned at the bottom of the article. anyway check it out, it works.

  5. This is absolutely fabulous! I’ve been searching for days trying to find out what VPN protocol to use (I didn’t know which one the Win7 built-in VPN server used), this made everything work.
    I have 3 PC’s at home, all of which have files that I like to be able to reach from the ‘Net and RDP is not a viable option. This way, I can get to my stuff at home with my phone if I need to.

  6. Set up the VPN, but cannot connect on my android device. Keeps giving me wrong username/password error. Ports are forwarded. :/

  7. Hi,
    Rob….you have to do exacly like in this guide. There is a known error with PPTP on Android. I had the same issue. The problem was with IP range.
    Change the IPV4 properties to specify a DHCP range

    Make sure the range you specify is on your LAN, and out of the range served by your DHCP server (you can updated your DHCP server to exclude this range).

    Without this it would not work.

  8. Happy belated new year to all!
    How EXACTLY should I do to “Make sure the range I specify is on my LAN”?,
    I believe I know where to check the range served by my DHCP server though.

    Thanks in advance guys 🙂


  9. @Javier DL
    Control Panel\Network and Internet\Network Connections
    Double click on Incoming Connections Icon
    Networking Tab / Properties of IPV4
    If your router is say set to provide say –, then you could enter to (or any range that does not overlap the router range and is a valid ip address.

    For others..
    If you are trying to connect to the VPN with a device already on the network via wifi try using your data connection instead.. I guess you would not be able to VPN onto a network that you are already on?

  10. Thank you so much for this guide. It has helped me get this working on my Galaxy S3.

  11. Hi – Thanks for the info. My problem comes after the VPN connection has been establish. Do I need another application to view my shared files on my Windows 7 computer on my Android? If this is true can you suggest one from the Google On Line Software Library

  12. everything is perfect, connected. now, how to view files??

  13. I was able to setup the incoming connection on my windows 7 computer, now i have an android device, i started setting up the VPN, first it asked for the name so i entered a name of my choice, then it asked for a server address so i entered the Local IP Address of my computer, then it asked for username and a password but i am wondering where i can find it. And yes I had setup the port forwarding for VPN-PPTP on the router as per the guide above. Someone please help!

  14. i follow the instruction above but when i try to connect using my android phone it fails..,,,,,

  15. I tried this once before and beat my head against the wall trying to get it working. I followed this article to the letter and got it working on the first try!

  16. anyone knows if this will encrypt the traffic between the 2?

  17. From the Netherlands.

    I was searching too the whole weekend.
    Thanks for the comments on this page.
    It is working..

    But i always wanna know, how does it works? I mean, whats happening when i make a connection?

    Thanks. Arend

  18. Thanks, this is the only guide that mentions the known error with PPTP on Android, which is mother-effing critical in the setup.

  19. @Shrey Marwah

    You need to do the following:
    1) forward port 1723
    2) go to configurationpanel -> windows firewall -> advanced. On the left, click incoming connections. Search for the “local port” tab and find port 1723. Check is this one is active.
    3) set a accountname and password at your PC. Go to account settings for this. If you try the following credentials;
    name: Shrey
    password: 1234 (change it later on for a safer one!)
    you should also use these with the VPN. Furthermore, use whatismyip.com to find your computer

    4) use cmd -> ipconfig to see what you local ip is ( for example).
    5) Change the IPV4 properties to specify a DHCP range, make sure the above ip adres within this range!
    6) find your IP address at http://whatismyipaddress.com/
    6) On android device, go to VPN, name it “Shrey”, use the ipaddress found at whatismyipaddress.com and NOT the local ipaddress. Click ok. If you now connect tot the VPN, use the PC login credentials and it should be fine!

  20. Hi, i follow the instruction is connecting,youtube works,google works,but the websites dont works.i have a Samsung Galaxy S3 Neo (Kitkat 4.4.2) http://www.gsmarena.com/samsung_i9300i_galaxy_s3_neo-6289.php
    Windows 7 as server PPTP.My friend use another phone and works everything.Why on my phone dosent work the websites….if i made a search in browser on google works,but when i clicked on link its stoping.

  21. Hello,

    I appreciate the guidance given here. I am looking forward to set up my own VPN, but unfortunately I am not able to connect.
    I have followed all the steps, I think, such as: hi

    1.I open port 1723 for the computer (windows 7) I want to connect to.
    2. I have enabled such port in Firewall settings.
    3. I have set up a new user account with its own password and username. When I create a VPN profile, in my Android tablet, I try to connect with such credentials.
    4. On setting the VPN profile I also include the public Ip of the computer I want to connect to.
    5. For the IPV4 properties I specified a dhcp range including the IP of the computer I want to connect to (from what some people say above it is not very clear if I need to include it or exclude it).
    I have tried setting different user accounts and all of them I have them activated as incoming connexion profiles.
    Please, what is failing here?
    Maybe just that the IP of the computer I want to connect to shouldn’t be included in the dhcp range??
    I would appreciate any hint.

    BTW, I tried too, at first, to connect from the tablet when it is part of the same home network. I suppose this is not possible as someone said above.
    Are there any other ways to remote control the computer when this is the case? Data connection as suggested above? How would this be set up please?
    Thank you a million in advance!

  22. You will see a confirmation message that the incoming VPN connection has been created, with the name of the computer name the remote user will need.

  23. In the “Change Adapter Settings” windows, you will see adapters showing wireless connections you’ve already configured on the computer, VPN connections, and the regular network adapter that is installed on the computer.

  24. Step 8 Navigate to the Security tab and select the specific Type of VPN from the drop-down list.

Leave a comment