Skip to content

Instantly share code, notes, and snippets.

@shalk
Forked from ychin/VPN (PPTP) EC2 Setup
Last active August 29, 2015 14:08
Show Gist options
  • Save shalk/c12072333daba54c0b46 to your computer and use it in GitHub Desktop.
Save shalk/c12072333daba54c0b46 to your computer and use it in GitHub Desktop.
# http://www.yzhang.net/blog/2013-03-07-pptp-vpn-ec2.html
# Run this in a root bash environment
#
# modify the <password>
yum -y update
wget http://poptop.sourceforge.net/yum/stable/rhel6/x86_64/pptpd-1.4.0-1.el6.x86_64.rpm
yum -y localinstall pptpd-1.4.0-1.el6.x86_64.rpm
echo localip 192.168.9.1 >> /etc/pptpd.conf
echo remoteip 192.168.9.11-30 >> /etc/pptpd.conf
echo ms-dns 8.8.8.8 >> /etc/ppp/options.pptpd
echo ms-dns 8.8.4.4 >> /etc/ppp/options.pptpd
echo "<username> pptpd <password> *" >> /etc/ppp/chap-secrets
echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
/sbin/sysctl -p
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" >> /etc/rc.local
/sbin/service pptpd start
chkconfig pptpd on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment