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


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


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 -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

1 comment:

  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