VPN (PPTPD) Server Setup on Debian

Note to self, grab the pptp server package,

apt-get install pptpd

Edit /etc/pptpd.conf add,

localip <vps-ip>
remoteip 10.1.0.1-100

Edit /etc/ppp/pptpd-options add,

refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128

ms-dns 8.8.8.8

proxyarp
nodefaultroute
lock
nobsdcomp
noipx
mtu 1490
mru 1490

Add users & passwords to /etc/ppp/chap-secrets

nakkaya    *    super_secret_pass    *

Enable IP Forwarding by,

echo 1 > /proc/sys/net/ipv4/ip_forward

Finally configure your iptables settings to enable access for PPTP clients,

iptables -A INPUT -i ppp+ -j ACCEPT
iptables -A OUTPUT -o ppp+ -j ACCEPT

iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p 47 -j ACCEPT
iptables -A OUTPUT -p 47 -j ACCEPT

iptables -F FORWARD
iptables -A FORWARD -j ACCEPT

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE