src: http://onlyzq.blog.51cto.com/1228/552564
1、使用apt-get命令从Debian的官方软件库中下载安装pptpd及其依赖的iptables和ppp,命令如下:
- apt-get -y install pptpd iptables ppp
2、配置pptpd。
- echo ms-dns 208.67.222.222 >> /etc/ppp/pptpd-options
- echo ms-dns 208.67.220.220 >> /etc/ppp/pptpd-options
- echo localip 192.168.99.1 >> /etc/pptpd.conf
- echo remoteip 192.168.99.9-99 >> /etc/pptpd.conf
- iptables -t nat -A POSTROUTING -s 192.168.99.0/24 -j MASQUERADE
- sed -i 's/exit\ 0/#exit\ 0/' /etc/rc.local
- echo iptables -t nat -A POSTROUTING -s 192.168.99.0/24 -j MASQUERADE >> /etc/rc.local
- echo exit 0 >> /etc/rc.local
- echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
- sysctl -p
- /etc/init.d/pptpd restart
3、添加用户
- echo tonyzhang * test * >> /etc/ppp/chap-secrets