Tuesday, May 28, 2013

Setup your own PPTP VPN server for Android


A. PPTP VPN server setup


1. Install the VPN server

#> apt-get install pptpd


2. Assign IP address for VPN client
#> vi /etc/pptpd.conf

localip 10.0.0.1
remoteip 10.0.0.100-200


3. Create VPN User &Password
#> vi /etc/ppp/chap-secrets

# client        server  secret                  IP addresses
user1 pptpd password1 *
user2 pptpd password2 *


4. Define DNS for VPN client
#> vi /etc/ppp/pptpd-options

ms-dns 8.8.8.8
ms-dns 8.8.4.4


5. PPTP setup completed, Restart the service.
#> service pptpd restart


6. Enable IP Forwarding, and apply changes.
#> vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

#> sysctl -p


7. Create NAT for iptables (most important!!!)
#> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save


8. Optional, enable communication between VPN clients
#> iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
#> iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
#> iptables --append FORWARD --in-interface eth0 -j ACCEPT



  • Steps above assume you have basic Linux Knowledge
  • Steps are based on Ubuntu 11.04
  • PPTP log was in "/var/log/syslog".
  • use "last |grep ppp" to show users logged in

B. Android VPN setup


1. In Android, go to "Setting" > "More" > "VPN", and type in Info as below.


2. Click on the connection your just created and type in username & password as defined in A.3.


3. After successful login, you will see a Key icon in Notification bar, plus a "VPN Activiated" message.




Ref : https://www.digitalocean.com/community/articles/how-to-setup-your-own-vpn-with-pptp


2 comments:

  1. PureVPN is a VPN service loved by users all over the world. Besides being the most secure and the reliable VPN service, it protects you online with 256-bit encrypted VPN servers strategically deployed in over 140 countries. Join PureVPN and get access to 80,000 IPs, fastest streaming, advanced online security, & more

    ReplyDelete
  2. Grab the best Christmas VPN Deal ever for just $1.34/month

    It’s time for the Best Christmas VPN Sale ! And Father Christmas is here with the best gift you can dream of this holiday season. Make the most of this opportunity with the best Christmas VPN Discount of the year!

    Enjoy 1825 days of complete online freedom with the internet right at your fingertips.

    ReplyDelete