http://www.centoscn.com/CentosServer/test/2015/0523/5511.html


# 命令,返回success正常
modprobe ppp-compress-18 &&echo success

# 检查tun支持,提示File descriptor in bad state正常
cat /dev/net/tun

# 检查ppp支持,提示No such device or address正常
cat /dev/ppp

# 安装
yum -y install make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.`uname -m`.rpm
yum install pptpd-1.4.0-*

# 配置

# vim  /etc/pptpd.conf
 localip 172.16.7.10       # 服务器IP
remoteip 172.16.7.11-15  (最大限制4个连接)  #vpn客户端的ip段

# vim /etc/ppp/options.pptpd
 ms-dns 202.106.0.20
ms-dns 8.8.8.8
debug 开启日志后,会在/var/log/messages里面

# 创建账户 /etc/ppp/chap-secrets
 "hitman"  *  "fuckyou"  *

# 系统参数调整 /etc/sysctl.conf
net.ipv4.ip_forward=1

# 生效
sysctl -p

# 防火墙以及路由
#iptables -t filter -A INPUT  -p tcp -m multiport --dport 22,1723  -j ACCEPT  
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# 解决上网慢的问题
iptables -A FORWARD -p tcp --syn -s 172.16.7.0/24 -j TCPMSS --set-mss 1356;

# 启动
service pptpd restart

# 开启iptables
chkconfig iptables on

chkconfig pptpd on
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""