CentOS 6.4 安装pptpd VPN服务
CentOS 6.4 安装pptpd VPN服务
一、环境介绍
pptpd 经常用来穿墙,或者是进行机房服务器管理
1)CentOS 6.4 64bit minimal
二、服务安装
$ wget http://poptop.sourceforge.net/yum/stable/rhel6Server/pptp-release-current.noarch.rpm
$ rpm -ivh pptp-release-current.noarch.rpm
$ yum install pptpd ppp
三、配置
$ vi /etc/pptpd.conf
option /etc/ppp/options.pptpd
localip 172.16.7.1
remoteip 172.16.7.30-100
$ 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
ms-dns 114.114.114.114
ms-dns 114.114.115.115
$ vi /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
dog pptpd pSc6Vgw55bb 172.16.7.31
四、启动
$ /etc/init.d/pptpd start
$ vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
$ sysctl -p
#iptables 转发用来上外网
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
五、检查
$ ps aux|grep pptpd
$ netstat -ntlp|grep pptpd
六、客户端安装
$ yum install -y pptp ppp pptp-setup
#用pptpsetup做客户配置是个不错的工具,当然也可以自己手下配置
#pptpsetup --create vpn-jiao --server x.x.x.x --username dog--password passwd --encrypt
#手动配置
$ vi /etc/ppp/peers/vpn-test
pty "pptp x.x.x.x --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name dog
remotename vpn-test
ipparam vpn-test
require-mppe-128
#手动配置密码
$ vi /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
dog vpn-test "pSc6Vgw55bb" *
#运行手动拨号
$ pppd call vpn-test updetach
#检查
$ ps aux|grep pptp