参考资料: http://www.dabu.info/centos6-4-structures-pptp-vpn.html http://www.ttlsa.com/linux/centos-install-pptp-vpn/以下在centos 6.4 64位下安装通过 最重要的一点,要对根据ppp版本选择对应的pptpd版本,下面是最常用的对应关系 ppp 2.4.4——————>pptpd 1.3.4 ppp 2.4.5——————>pptpd 1.4.0 下载地址 wget http://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.5-33.0.rhel6.x86_64.rpm wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm rpm -ivh ppp-2.4.5-33.0.rhel6.x86_64.rpm rpm -ivh pptpd-1.4.0-1.el6.x86_64.rpm vi /etc/pptpd.conf,末尾添加 localip 192.168.9.1 remoteip 192.168.9.11-30 vi /etc/ppp/options.pptpd,修改DNS如下 ms-dns 8.8.8.8 ms-dns 8.8.4.4 vi /etc/ppp/chap-secrets,配置用户名密码 格式:用户名 pptpd 密码 * user1 pptpd 123456 * user2 pptpd 123456 * vi /etc/sysctl.conf net.ipv4.ip_forward = 1 使配置立即生效: /sbin/sysctl -p //这一步是可选的 启用日志 vi /etc/syslog.conf 追加一行: daemon.debug /var/log/pptpd.log 配置iptables 执行命令: /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.9.0/24 -j MASQUERADE /etc/init.d/iptables save 防火墙最终配置如下: # Generated by iptables-save v1.4.7 on Tue Sep 1 05:06:44 2015 *nat :PREROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [1:124] :OUTPUT ACCEPT [1:124] -A POSTROUTING -s 192.168.9.0/24 -o eth0 -j MASQUERADE COMMIT *filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -p icmp -j DROP -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT //pptd端口 -A INPUT -p tcp -m tcp --dport 2211 -j ACCEPT //ss5端口 -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT //ssh端口 -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT COMMIT # Completed on Tue Sep 1 05:06:44 2015 相关文档 http://blog.163.com/f_jinyi/blog/static/3118031520101126104227334/ http://www.linuxidc.com/Linux/2013-09/89667p2.htm http://www.it165.net/os/html/201304/5052.html http://guojiping.blog.51cto.com/5635432/1317367 http://my.oschina.net/lionel45/blog/179164 http://my.oschina.net/praise/blog/135260 (责任编辑:IT) |