Configure PPTP in Ubuntu
apt-get install pptp-linux
The format should be
pptpuser PPTP pptppassword *
Create route script
#!/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
pty "pptp <HOST> --nolaunchpppd" name <USER> remotename PPTP require-mppe-128 file /etc/ppp/options.pptp ipparam <CONNECTON>
iptables -A INPUT -i pptp -j ACCEPT iptables -A OUTPUT -o pptp -j ACCEPT
Connect and disconnect
pon <CONNECTON> poff <CONNECTION>
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.