1. 修改下方有中文备注的区域,然后在SSH终端直接执行即可 by miefen.com
  2. ===========================================================================
  3. rpm -Uvh http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
  4. yum -y install ppp pptpd
  5. cp /etc/pptpd.conf /etc/pptpd.conf.bak
  6. cat >/etc/pptpd.conf<<EOF
  7. option /etc/ppp/options.pptpd
  8. logwtmp
  9. localip 10.0.10.1
  10. remoteip 10.0.10.2-254
  11. EOF
  12. cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
  13. cat >/etc/ppp/options.pptpd<<EOF
  14. name pptpd
  15. refuse-pap
  16. refuse-chap
  17. refuse-mschap
  18. require-mschap-v2
  19. require-mppe-128
  20. proxyarp
  21. lock
  22. nobsdcomp
  23. novj
  24. novjccomp
  25. nologfd
  26. ms-dns 8.8.8.8
  27. ms-dns 8.8.4.4
  28. EOF
  29. cp /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak
  30. cat >/etc/ppp/chap-secrets<<EOF
  31. 用户名 pptpd 密码 *
  32. EOF
  33. cp /etc/sysctl.conf /etc/sysctl.conf.bak
  34. cat >/etc/sysctl.conf<<EOF
  35. net.ipv4.ip_forward = 1
  36. EOF
  37. sysctl -p
  38. chmod +x /etc/rc.d/rc.local
  39. echo "iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -j SNAT --to-source VPS公网IP" >> /etc/rc.d/rc.local
  40. iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -j SNAT --to-source VPS公网IP
  41. systemctl start pptpd
  42. systemctl enable pptpd.service

Install PPTP VPN on CentOS 7