安装须知
OpenVZ用户循例检查相关模块(TUN/TAP/PPP)有无正常开启, 如果没有开启相关模块是不能安装的。
(连接时提示错误800)
貌似只要PPP模块正常就可以安装了。
OpenVZ用户循例检查相关模块(TUN/TAP/PPP)有无正常开启, 如果没有开启相关模块是不能安装的。
(连接时提示错误800)
貌似只要PPP模块正常就可以安装了。
cat /dev/net/tun
返回以下结果即代表TUN模块有正常开启: cat: /dev/net/tun: File descriptor in bad state
cat /dev/ppp
返回以下结果即代表PPP模块有正常开启: cat: /dev/ppp: No such device or address
如返回“Permission denied”则表示没有权限开启PPP模块
发TK给客服去开启!123systems的就放弃吧,不支持PPP,但可以装openvpn~
添加或删除帐号:
vi /etc/ppp/chap-secrets
添加帐号格式必须保持与原本一致 如:
youruser pptpd yourpassword *
youruser yourpassword改成你的用户和密码
开始一键安装:
wget http://img.crazyfeng.com/sh/pptpd/centos6_pptpd.sh
chmod +x centos6_pptpd.sh
./centos6_pptpd.sh
sh内容如下:
#!/bin/bash
clear
echo ""
echo -e "\033[44;37m ###################################### \033[0m"
echo -e "\033[44;37m # PPTPD Installer for CentOS 6.x # \033[0m"
echo -e "\033[44;37m ###################################### \033[0m"
echo ""## Define ##
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo -e "\033[47;30m * Press any key to start installing PPTP VPN \033[0m"
echo -e "\033[47;30m * Or press Ctrl+C to cancel the installation \033[0m"
char=`get_char`
echo ""## Start ##
echo "nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain" >> /etc/resolv.conf
service network restartyum remove -y pptpd ppp
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
rm -rf /etc/pptpd.conf
rm -rf /etc/ppparch=`uname -m`
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.el6.$arch.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.5-23.0.rhel6.$arch.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/dkms-2.0.17.5-1.noarch.rpm
yum -y update
yum -y upgrade
yum -y install make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers policycoreutils
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.5-23.0.rhel6.$arch.rpm
rpm -Uvh pptpd-1.3.4-2.el6.$arch.rpmrm -r /dev/ppp
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "mknod /dev/ppp c 108 0" >> /etc/rc.local
echo "echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
echo "localip 10.0.10.1" >> /etc/pptpd.conf
echo "remoteip 10.0.10.2-254" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpdpass=`openssl rand 6 -base64`
if [ "$1" != "" ]
then pass=$1
fiecho "OTW pptpd ${pass} *" >> /etc/ppp/chap-secretsiptables -t nat -A POSTROUTING -s 10.0.10.0/24 -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`
iptables -A FORWARD -p tcp --syn -s 10.0.10.0/24 -j TCPMSS --set-mss 1356
iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
service iptables savechkconfig iptables on
chkconfig pptpd onservice iptables start
service pptpd start## Completed ##
echo ""
echo -e "\033[44;37m ###################################### \033[0m"
echo -e "\033[44;37m # PPTPD Installer for CentOS 6.x # \033[0m"
echo -e "\033[44;37m ###################################### \033[0m"
echo ""
echo -e "VPN service is installed, your username is\033[32m OTW\033[0m, password is\033[32m ${pass}\033[0m"
echo ""
没有评论:
发表评论