Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PPTPD VPN in CentOS 6

Install packages

yum install ppp iptables
rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum install pptpd

Route config

  • vi /etc/sysctl.conf
  • net.ipv4.ip_forward = 1
  • verify it: /sbin/sysctl -p

ppp config

/etc/ppp/options.pptpd

update dns config with google dns

ms-dns 8.8.8.8
ms-dns 8.8.4.4

/etc/pptpd.conf

localip 10.8.8.1
remoteip 10.8.8.2-245

/etc/ppp/chap-secrets

add pptpd login account, e.g. buddy pptpd "mypassword" *

start pptpd

  • chkconfig pptpd on
  • service pptpd start

iptables

add following rules then /etc/init.d/iptables restart

/sbin/iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 47 -j ACCEPT
/sbin/iptables -A INPUT -p gre -j ACCEPT
iptables -A POSTROUTING -t nat -s 10.8.8.0/24 -o eth0 -j MASQUERADE

PS: the last rule seems not correct thus I change following to rules config file NAS part directly

  • -I POSTROUTING -s 10.8.8.0/24 -o eth0 -j MASQUERADE

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment