CentOS 5.4下 PPTP VPN

CentOS 5.4下 PPTP VPN

1、安装相关软件

32位版:

yuminstall-ypppiptables

wgethttp://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel5.1.i386.rpm

rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm

64位版:

yuminstall-ypppiptables

wgethttp://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel5.1.x86_64.rpm

rpm -ivh pptpd-1.3.4-1.rhel5.1.x86_64.rpm

2、配置文件编写

①、配置文件/etc/ppp/options.pptpd

mv/etc/ppp/options.pptpd/etc/ppp/options.pptpd.bak

vi/etc/ppp/options.pptpd

输入以下内容:

namepptpd

refuse-pap

refuse-chap

refuse-mschap

require-mschap-v2

require-mppe-128

proxyarp

lock

nobsdcomp

novj

novjccomp

nologfd

idle2592000

ms-dns8.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

输入以下内容

#SecretsforauthenticationusingCHAP

#clientserversecretIPaddresses

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

localip192.168.9.1

remoteip 192.168.9.11-30

注:为拨入VPN的用户动态分配192.168.9.11~192.168.9.30之间的IP

④、配置文件/etc/sysctl.confvi /etc/sysctl.conf

修改以下内容:net.ipv4.ip_forward = 1

保存、退出后执行:/sbin/sysctl -p

3、启动PPTP VPN 服务器端:/sbin/service pptpd start

4、启动iptables:

/sbin/serviceiptablesstart

/sbin/iptables-tnat-APOSTROUTING-oeth0-s192.168.9.0/24-jMASQUERADE

相关推荐