来源:http://blog.s135.com/pptp_vpn/
—————————————————————
一、CentOS 5.3 下 PPTP VPN 服务器安装
1、安装相关软件
32位版:
yum install -y ppp iptables wget https://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.rhel5.x86_64.rpm rpm -ivh pptpd-1.3.4-2.rhel5.i386.rpm
64位版:
yum install -y ppp iptables wget https://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.rhel5.x86_64.rpm rpm -ivh pptpd-1.3.4-2.rhel5.x86_64.rpm
2、配置文件编写
①、配置文件/etc/ppp/options.pptpd
mv /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak vi /etc/ppp/options.pptpd
输入以下内容:
name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd idle 2592000< ms-dns 8.8.8.8 ms-dns 8.8.4.4
②、配置文件/etc/ppp/chap-secrets
mv /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak vi /etc/ppp/chap-secrets
输入以下内容
# Secrets for authentication using CHAP # client server secret IP addresses myusername pptpd mypassword *
注:这里的myusername和mypassword即为PPTP VPN的登录用户名和密码
③、配置文件/etc/pptpd.conf
mv /etc/pptpd.conf /etc/pptpd.conf.bak vi /etc/pptpd.conf
输入以下内容:
option /etc/ppp/options.pptpd logwtmp localip 192.168.9.1 remoteip 192.168.9.11-30
注:为拨入VPN的用户动态分配192.168.9.11~192.168.9.30之间的IP
④、配置文件/etc/sysctl.conf
vi /etc/sysctl.conf
修改以下内容:
net.ipv4.ip_forward = 1
保存、退出后执行:
/sbin/sysctl -p
3、启动PPTP VPN 服务器端:
/sbin/service pptpd start
4、启动iptables:
/sbin/service iptables start /sbin/iptables -I FORWARD -s 192.168.9.0/24 -j ACCEPT /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.9.0/24 -j MASQUERADE