- 修改下方有中文备注的区域,然后在SSH终端直接执行即可 by miefen.com
- ===========================================================================
- rpm -Uvh http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
- yum -y install ppp pptpd
- cp /etc/pptpd.conf /etc/pptpd.conf.bak
- cat >/etc/pptpd.conf<<EOF
- option /etc/ppp/options.pptpd
- logwtmp
- localip 10.0.10.1
- remoteip 10.0.10.2-254
- EOF
- cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
- cat >/etc/ppp/options.pptpd<<EOF
- name pptpd
- refuse-pap
- refuse-chap
- refuse-mschap
- require-mschap-v2
- require-mppe-128
- proxyarp
- lock
- nobsdcomp
- novj
- novjccomp
- nologfd
- ms-dns 8.8.8.8
- ms-dns 8.8.4.4
- EOF
- cp /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak
- cat >/etc/ppp/chap-secrets<<EOF
- 用户名 pptpd 密码 *
- EOF
- cp /etc/sysctl.conf /etc/sysctl.conf.bak
- cat >/etc/sysctl.conf<<EOF
- net.ipv4.ip_forward = 1
- EOF
- sysctl -p
- chmod +x /etc/rc.d/rc.local
- echo "iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -j SNAT --to-source VPS公网IP" >> /etc/rc.d/rc.local
- iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -j SNAT --to-source VPS公网IP
- systemctl start pptpd
- systemctl enable pptpd.service
Install PPTP VPN on CentOS 7