Configure PPTP in Ubuntu
Install packages
apt-get install pptp-linux
Configure password
vi /etc/ppp/chap-secrets
The format should be
pptpuser PPTP pptppassword *
Create route script
Create file /etc/ppp/ip-up.d/route-traffic
#!/bin/bash
route add -net 192.168.1.0/8 dev ppp0
Change mode to executable
chmod +x /etc/ppp/ip-up.d/route-traffic
Create dial up configure
The name of file is defined as connection name, such as /etc/ppp/peers/<CONNECTON>
pty "pptp <HOST> --nolaunchpppd"
name <USER>
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam <CONNECTON>
Open filewall
iptables -A INPUT -i pptp -j ACCEPT
iptables -A OUTPUT -o pptp -j ACCEPT
Connect and disconnect
pon <CONNECTON>
poff <CONNECTION>
Troubleshooting
If didn't configure PPTP Passthrough on your NAT, then PPTP will failed.
PPTP uses a TCP channel on port 1723 for control and the GRE protocol to encapsulate data and create a VPN tunnel. The issue isn’t really PTPP itself but GRE; GRE doesn’t use ports. Since a requirement of NAT is that the connection must use an IP address and port number it doesn’t work with GRE. This is what PTPP passthrough addresses.
References
Set up Linux PPTP Client from the Terminal
Connect to PPTP server via command line on Ubuntu
pptp - 'Administrative Shutdown'. Error code is 0, Cause code is 0