Skip to content

Instantly share code, notes, and snippets.

@feng92f
Forked from codeachange/pptpd_installer.sh
Created July 7, 2014 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feng92f/c09e28207314a96228ab to your computer and use it in GitHub Desktop.
Save feng92f/c09e28207314a96228ab to your computer and use it in GitHub Desktop.
#!/bin/bash
# CentOS release 6.4
# https://www.digitalocean.com/community/articles/how-to-setup-your-own-vpn-with-pptp
rpm --import http://poptop.sourceforge.net/yum/RPM-GPG-KEY-PPTP
rpm -i http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install pptpd
echo "localip 192.168.9.1" >> /etc/pptpd.conf
echo "remoteip 192.168.9.100-199" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 4.2.2.1" >> /etc/ppp/options.pptpd
# username:vpnproxy, password:vpnproxy.pwd
echo "vpnproxy pptpd vpnproxy.pwd *" >> /etc/ppp/chap-secrets
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
service iptables save
chkconfig pptpd on
service pptpd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment