2016-11-01
http://blog.51yip.com/linux/1404.html
https://linux.cn/article-3376-1.html 此例子有不足,更改如下
http://blog.163.com/monk…popo/blog/static/208680220111014101233949/
http://rainbird.blog.51cto.com/211214/394403/ 针对ufw
https://www.crazycen.com/linux/1360.html 不错的ufw
sudoapt-get install pptpd
编辑配置文件:
sudovi /etc/pptpd.conf
- localip #vpn 服务器地址 10.100.0.1
- remoteip 10.100.0.2-10
第二行为分配的ip段
设置dns
sudovi /etc/ppp/pptpd-options
- ms-dns 8.8.8.8
- ms-dns 8.8.4.4
设置账号:
sudovi /etc/ppp/chap-secrets
sudovi /etc/sysctl.conf
- net.ipv4.ip_forward=1
- sudosysctl -p
- sudo iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
保存规则;
sudo vi /etc/iptables-rules 创建,并赋予当期那用户权限
- sudo iptables-save > /etc/iptables-rules
- sudovi /etc/network/interfaces
- pre-up iptables-restore < /etc/iptables-rules
- sudo iptables -A FORWARD -s 10.100.0.0/24 -p tcp -m tcp —tcp-flags SYN,RST SYN -j TCPMSS —set-mss 1200
- sudo iptables-save > /etc/iptables-rules
恢复root权限 /etc/iptables-rules
已经成功