冰糖葫芦 发表于 2013-7-4 21:04:20

求个搭建vpn一键包

本帖最后由 冰糖葫芦 于 2013-7-4 21:05 编辑

前面看到个三合一的,但好像不灵了,如图:



求个比较新的简单点的教程,谢大神
013.gif

wolf 发表于 2013-7-4 21:15:31

同求一个。一直手工很麻烦

polar 发表于 2013-7-4 21:16:39

有一键安装包的.呀

金盾 发表于 2013-7-4 21:18:10

CentOS Linux VPS架设VPN详细教程[图解]http://www.20264.com/?post=94

冰糖葫芦 发表于 2013-7-4 22:05:07


金盾 发表于 2013-7-4 21:18

back.gif

CentOS Linux VPS架设VPN详细教程[图解]http://www.20264.com/?post=94
有木有一键的?这个之前尝试过,一直连不上,按照这个做成功的有吗?

Andreas 发表于 2013-7-4 21:18:00

[*]#!/bin/bash
[*]clear
[*]if [ $(id -u) != "0" ]; then
[*]    printf "Error: You must be root to run this tool!\n"
[*]    exit 1
[*]fi
[*]
[*]host_ip=`ifconfig eth0 | awk '/inet addr/ {print $2}' | awk -F ':' '{print $2}'`
[*]cur_dir=`pwd`
[*]read -p "(Please input PSK: )" psk
[*]if [ "$psk" = "" ]; then
[*]      psk="MJJ"
[*]fi
[*]
[*]read -p "Enter vpn username: " username
[*]if [ "$username" = "" ];then
[*]      username="vpn"
[*]fi
[*]
[*]read -p "Enter vpn password: " userpsw
[*]if [ "$userpsw" = "" ];then
[*]      userpsw="vpn"
[*]fi
[*]
[*]clear
[*]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 "ServerIP:"
[*]echo "$host_ip"
[*]echo ""
[*]echo "PSK:"
[*]echo "$psk"
[*]echo ""
[*]echo "VPN Account:"
[*]echo "$username"
[*]echo ""
[*]echo "Account Password:"
[*]echo "$userpsw"
[*]echo ""
[*]echo "Press any key to start..."
[*]char=`get_char`
[*]clear
[*]
[*]yum -y update
[*]yum remove-y pptpd ppp
[*]yum install -y make gcc gmp-devel bison flex libpcap-devel ppp lsof perl iptables
[*]yum install -y libpcap gcc-c++ logrotate tar cpio pam tcp_wrappers
[*]
[*]wget http://fastlnmp.googlecode.com/files/dkms-2.0.17.5-1.noarch.rpm
[*]wget http://fastlnmp.googlecode.com/files/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
[*]wget http://fastlnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.i386.rpm
[*]
[*]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 -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm
[*]
[*]
[*]wget http://www.openswan.org/download/openswan-2.6.34.tar.gz
[*]tar zxvf openswan-2.6.34.tar.gz
[*]cd openswan-2.6.34/
[*]make programs install
[*]cd ../
[*]
[*]cat > /etc/ipsec.conf/etc/ipsec.secrets$each/accept_redirects
[*]echo 0 > $each/send_redirects
[*]done
[*]echo 1 > /proc/sys/net/core/xfrm_larval_drop
[*]iptables --table nat --append POSTROUTING -o eth0 --jump MASQUERADE
[*]
[*]service iptables save
[*]service iptables restart
[*]chkconfig iptables on
[*]
[*]sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
[*]sysctl -p
[*]
[*]/etc/init.d/ipsec restart
[*]ipsec verify
[*]
[*]cd $cur_dir
[*]wget http://downloads.sourceforge.net/project/rp-l2tp/rp-l2tp/0.4/rp-l2tp-0.4.tar.gz
[*]tar zxvf rp-l2tp-0.4.tar.gz
[*]cd rp-l2tp-0.4
[*]./configure
[*]make
[*]cp handlers/l2tp-control /usr/local/sbin/
[*]mkdir /var/run/xl2tpd/
[*]ln -s /usr/local/sbin/l2tp-control /var/run/xl2tpd/l2tp-control
[*]
[*]cd $cur_dir
[*]wgethttp://fastlnmp.googlecode.com/files/xl2tpd-1.2.8.tar
[*]tar zxvf xl2tpd-1.2.8.tar
[*]cd xl2tpd-1.2.8
[*]make install
[*]cd ..
[*]
[*]mkdir -p /etc/xl2tpd
[*]touch /etc/xl2tpd/xl2tpd.conf
[*]cat >> /etc/xl2tpd/xl2tpd.conf > /etc/ppp/options.xl2tpd > /etc/pptpd.conf
[*]echo "remoteip 10.85.92.10-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.pptpd
[*]
[*]chkconfig pptpd on
[*]service pptpd restart
[*]
[*]echo "$username l2tpd $userpsw *" >> /etc/ppp/chap-secrets
[*]echo "$username pptpd $userpsw *" >> /etc/ppp/chap-secrets
[*]/usr/local/sbin/xl2tpd
[*]
[*]cat >> /etc/rc.local\$each/accept_redirects
[*]      echo 0 > \$each/send_redirects
[*]done
[*]echo 1 > /proc/sys/net/core/xfrm_larval_drop
[*]/etc/init.d/ipsec restart
[*]/usr/local/sbin/xl2tpd
[*]EOF
[*]
[*]clear
[*]
[*]ipsec verify
[*]
[*]printf "
[*]if there are no above, then you can
[*]connect to your L2TP&PPTP VPN Server with the default
[*]user/pass below:
[*]
[*]ServerIP:$host_ip
[*]username:$username
[*]password:$userpsw
[*]PSK:$psk (for L2TP VPN)
[*]"
[*]复制代码

金盾 发表于 2013-7-4 22:05:13


冰糖葫芦 发表于 2013-7-4 22:05

back.gif

有木有一键的?这个之前尝试过,一直连不上,按照这个做成功的有吗?
我就是按照这个搭建了,正在使用中

yywudi 发表于 2013-7-4 22:06:12

http://www.yishanhome.com/archives/307

李毅 发表于 2013-7-4 22:05:00

VPN你不会搭建的话 按着网上的教程一步一步搭建就是了,自己做几次也好

hol0306Ruclinux 发表于 2013-7-4 22:17:28

diahosting博客上有来自: iPhone客户端
lol.gif
慢慢自己折腾就懂了
页: [1] 2
查看完整版本: 求个搭建vpn一键包