|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!本教程合用于OpenvVPS、XenVPS大概KVMVPS。
1、运转以下下令:前往的必需是:cat:/dev/net/tun:Filedescriptorinbadstate 运转:前往的必需是:cat:/dev/ppp:Nosuchdeviceoraddress 假如下面前往的不是这两个了局的话,请与VPS客服接洽守旧ppp和tun权限.
2、下载vpn(CentOS6公用)一键装置包wgethttp://www.ckuyun.com/shell/vpn_centos6.sh
chmoda+xvpn_centos6.sh 3、运转一键装置包会有三个选择:
1.装置VPN办事
2.修复VPN
3.增加VPN用户
起首输出1,回车,VPS入手下手装置VPN办事.
4、增加VPN用户
bashvpn_centos6.sh
选择3,然后输出用户名和暗码,OK
5、修复VPN办事
假如VPN拨号产生毛病,能够试着修复VPN,然后重启VPS选择2,然后reboot
以上这篇是转自乔年夜海的,不外有一些细节修正:
1,随机用户名或暗码修正增加:
编纂“/etc/ppp/chap-secrets”,依照以下,交换红字局部:重启便可。
2,这个一键装置包有些中央反复了,从头修正下:#!/bin/bash
functioninstallVPN(){
echo"begintoinstallVPNservices";
#checkwethervpssuppotpppandtun
yumremove-ypptpdppp
iptables--flushPOSTROUTING--tablenat
iptables--flushFORWARD
rm-rf/etc/pptpd.conf
rm-rf/etc/ppp
arch=`uname-m`
wget-chttp://poptop.sourceforge.net/yum/stable/packages/dkms-2.0.17.5-1.noarch.rpm
wget-chttp://poptop.sourceforge.net/yum/stable/packages/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
wgethttp://www.ckuyun.com/downloads/pptpd-1.3.4-2.el6.$arch.rpm
wgethttp://www.ckuyun.com/downloads/ppp-2.4.5-17.0.rhel6.$arch.rpm
yum-yinstallmakelibpcapiptablesgcc-c++logrotatetarcpioperlpamtcp_wrappers
rpm-ivhdkms-2.0.17.5-1.noarch.rpm
rpm-ivhkernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
rpm-qakernel_ppp_mppe
rpm-Uvhppp-2.4.5-17.0.rhel6.$arch.rpm
rpm-ivhpptpd-1.3.4-2.el6.$arch.rpm
mknod/dev/pppc1080
echo1>/proc/sys/net/ipv4/ip_forward
echo"mknod/dev/pppc1080">>/etc/rc.local
echo"echo1>/proc/sys/net/ipv4/ip_forward">>/etc/rc.local
echo"localip172.16.36.1">>/etc/pptpd.conf
echo"remoteip172.16.36.2-254">>/etc/pptpd.conf
echo"ms-dns8.8.8.8">>/etc/ppp/options.pptpd
echo"ms-dns8.8.4.4">>/etc/ppp/options.pptpd
pass=`opensslrand6-base64`
if["$1"!=""]
thenpass=$1
fi
echo"vpnpptpd${pass}*">>/etc/ppp/chap-secrets
iptables-tnat-APOSTROUTING-s172.16.36.0/24-jSNAT--to-source`ifconfig|grepinetaddr:|grep-v127.0.0.1|cut-d:-f2|awkNR==1{print$1}`
iptables-AFORWARD-ptcp--syn-s172.16.36.0/24-jTCPMSS--set-mss1356
serviceiptablessave
chkconfigiptableson
chkconfigpptpdon
serviceiptablesstart
servicepptpdstart
echo"VPNserviceisinstalled,yourVPNusernameisvpn,VPNpasswordis${pass}"
}
functionrepaireVPN(){
echo"begintorepaireVPN";
mknod/dev/pppc1080
serviceiptablesrestart
servicepptpdstart
}
functionaddVPNuser(){
echo"inputusername:"
readusername
echo"inputpassword:"
readuserpassword
echo"${username}pptpd${userpassword}*">>/etc/ppp/chap-secrets
serviceiptablesrestart
servicepptpdstart
}
echo"whichdoyouwantto?inputthenumber."
echo"1.installVPNservice"
echo"2.repaireVPNservice"
echo"3.addVPNuser"
readnum
case"$num"in
[1])(installVPN);;
[2])(repaireVPN);;
[3])(addVPNuser);;
*)echo"nothing,exit";;
esac 增补下源码下载地点:http://poptop.sourceforge.net/yum/stable/packages/
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|