Centos5下安装PPTPD(含一键包)  

1.删除之前已安装的相关软件:

?View Code HTML
1
2
3
yum remove -y pptpd ppp
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp
删除iptables规则:

?View Code HTML
1
iptables –flush POSTROUTING –table nat
2.下载相关软件:

?View Code HTML
1
2
3
4
wget http://www.vpsyou.com/sources/dkms-2.0.17.5-1.noarch.rpm
wget http://www.vpsyou.com/sources/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
wget http://www.vpsyou.com/sources/pptpd-1.3.4-1.rhel5.1.i386.rpm
wget http://www.vpsyou.com/sources/ppp-2.4.4-9.0.rhel5.i386.rpm
3.安装相关软件

?View Code HTML
1
2
3
4
5
6
yum -y install make libpcap iptables gcc-c++ logrotate tar vim-minimal cpio perl pam tcp_wrappers
rpm -ivh dkms-2.0.17.5-1.noarch.rpm
rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
rpm -qa kernel_ppp_mppe
rpm -Uvh ppp-2.4.4-9.0.rhel5.i386.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm
4.相关配置:

a.ppp配置:

?View Code HTML
1
mknod /dev/ppp c 108 0
设置vps启动时加载此项,编辑/etc/rc.local,加入:

?View Code HTML
1
mknod /dev/ppp c 108 0
修改配置文件/etc/ppp/options.pptpd,加入:

?View Code HTML
1
2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
b.配置文件/etc/sysctl.conf,修改

?View Code HTML
1
net.ipv4.ip_forward = 0
为:

?View Code HTML
1
net.ipv4.ip_forward = 1
然后执行:

?View Code HTML
1
/sbin/sysctl -p
c.配置文件/etc/pptpd.conf,加入:

?View Code HTML
1
2
localip 192.168.9.1
remoteip 192.168.9.11-30
d.修改配置文件/etc/ppp/chap-secrets,加入:

?View Code HTML
1
2
3
# Secrets for authentication using CHAP
# client server secret IP addresses
myusername pptpd mypassword *
PS:myusername为vpn用户名,mypassword为密码

5.启动iptables.加入规则,启动pptpd

?View Code HTML
1
2
3
4
5
6
7
8
iptables -t nat -A POSTROUTING -s 192.168.9.0/255.255.255.0 -j SNAT –to-source `ifconfig | grep ‘inet addr:’| grep -v ‘127.0.0.1’ | cut -d: -f2 | awk ‘NR==1 { print $1}’`
service iptables save

chkconfig iptables on
chkconfig pptpd on

service iptables start
service pptpd start
安装一键包地址:pptpd.sh

请订阅本站 RSS feed 订阅到信箱 ,欢迎 Donate 或者 上面的广告内容 支持三十岁

本文链接:Centos5下安装PPTPD(含一键包)

转载声明:本站文章若无特别说明,皆为原创,转载请注明来源:三十岁,谢谢!^^


分享到:          
评论关闭