在CentOS下搭建PPTP服务器

安装

rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install pptpd

配置

  • /etc/ppp/options.pptpd

ms-dns 8.8.8.8
ms-dns 8.8.4.4
  • /etc/pptpd.conf

localip 172.16.0.1
remoteip 172.16.0.2-254
  • /etc/ppp/chap-secrets

VPN用户名 pptpd VPN密码 *
  • /etc/sysctl.conf

net.ipv4.ip_forward 1
# net.ipv4.tcp_syncookies 1  (注释掉此行代码)

接下来执行sysctl -p命令使配置生效

错误

如果在执行sysctl -p出现unknow key错误,则执行下面代码后重新执行sysctl -p

modprobe bridge
lsmod|grep bridge

防火墙配置

iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -o eth0 -j MASQUERADE

最后保存规则service iptables save,然后重启防火墙service iptables restart

你可能感兴趣的:(linux,pptpd)