( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKBase.class.php on line 114
Call Stack
#TimeMemoryFunctionLocation
10.0019413888{main}( ).../index.php:0
20.08084264464Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.437015915504Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.437115915560Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.437215915936Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.437215915936Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.437315916032Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.437615954272require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.441316246216GKTemplate->__construct( ).../component.php:31
100.447416400096GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.448016444064require_once( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKMenu.php' ).../helper.menu.php:19

( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKHandheld.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0019413888{main}( ).../index.php:0
20.08084264464Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.437015915504Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.437115915560Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.437215915936Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.437215915936Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.437315916032Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.437615954272require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.441316246216GKTemplate->__construct( ).../component.php:31
100.450216567312GKTemplateMenu->getMenuType( ).../gk.framework.php:85
L2TP 一键安装包
Logo
Print this page

L2TP 一键安装包

转贴自

http://zeddicus.com/a-key-installation-package-l2tp

 

这是 L2TP over IPSec Server 一键安装包的发布页,此安装包首发于 VPSYou.com

当前版本:1.2

发行版版本兼容性
CentOS5.2 32/64bit测试通过
CentOS5.3 32/64bit测试通过
CentOS5.4 32/64bit测试通过
CentOS5.5 32/64bit测试通过
Ubuntu9.10 Karmic 32/64bit测试通过
Ubuntu10.04 Lucid 32/64bit测试通过
Debian5.0 Lenny 32/64bit测试通过
Fedora13 32/64bit测试通过

配置步骤:

CentOS / Fedora:

?View Code LANGUAGE

Ubuntu / Debian:

?View Code LANGUAGE

备注:安装按提示操作,相关截图及细节请移驾至:http://www.vpsyou.com/l2tp-vpn

 

代码

-----------------------------------------------------------------------------------------------------------------

#!/bin/bash

if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
#                                                  #
# This is a Shell-Based tool of l2tp installation  #
# Version: 1.2                                     #
# Author: Zed Lau                                  #
# Website: http://zeddicus.com                     #
#                                                  #
####################################################
"
vpsip=`hostname -i`

iprange="10.0.99"
echo "Please input IP-Range:"
read -p "(Default Range: 10.0.99):" iprange
if [ "$iprange" = "" ]; then
iprange="10.0.99"
fi

mypsk="vpsyou.com"
echo "Please input PSK:"
read -p "(Default PSK: vpsyou.com):" mypsk
if [ "$mypsk" = "" ]; then
mypsk="vpsyou.com"
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 "$vpsip"
echo ""
echo "Server Local IP:"
echo "$iprange.1"
echo ""
echo "Client Remote IP Range:"
echo "$iprange.2-$iprange.254"
echo ""
echo "PSK:"
echo "$mypsk"
echo ""
echo "Press any key to start..."
char=`get_char`
clear
mknod /dev/random c 1 9
yum -y update
yum -y upgrade
yum install -y ppp iptables make gcc gmp-devel xmlto bison flex xmlto libpcap-devel lsof vim-enhanced
mkdir /ztmp
mkdir /ztmp/l2tp
cd /ztmp/l2tp
wget http://www.openswan.org/download/openswan-2.6.24.tar.gz
tar zxvf openswan-2.6.24.tar.gz
cd openswan-2.6.24
make programs install
rm -rf /etc/ipsec.conf
touch /etc/ipsec.conf
cat >>/etc/ipsec.conf<<EOF
config setup
nat_traversal=yes
virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12
oe=off
protostack=netkey

conn L2TP-PSK-NAT
rightsubnet=vhost:%priv
also=L2TP-PSK-noNAT

conn L2TP-PSK-noNAT
authby=secret
pfs=no
auto=add
keyingtries=3
rekey=no
ikelifetime=8h
keylife=1h
type=transport
left=$vpsip
leftprotoport=17/1701
right=%any
rightprotoport=17/%any
EOF
cat >>/etc/ipsec.secrets<<EOF
$vpsip %any: PSK "$mypsk"
EOF
sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
sysctl -p
iptables --table nat --append POSTROUTING --jump MASQUERADE
for each in /proc/sys/net/ipv4/conf/*
do
echo 0 > $each/accept_redirects
echo 0 > $each/send_redirects
done
/etc/init.d/ipsec restart
ipsec verify
cd /ztmp/l2tp
wget http://mirror.zeddicus.com/sources/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 /ztmp/l2tp
wget http://mirror.zeddicus.com/sources/xl2tpd-1.2.4.tar.gz
tar zxvf xl2tpd-1.2.4.tar.gz
cd xl2tpd-1.2.4
make install
mkdir /etc/xl2tpd
rm -rf /etc/xl2tpd/xl2tpd.conf
touch /etc/xl2tpd/xl2tpd.conf
cat >>/etc/xl2tpd/xl2tpd.conf<<EOF
[global]
ipsec saref = yes
[lns default]
ip range = $iprange.2-$iprange.254
local ip = $iprange.1
refuse chap = yes
refuse pap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
EOF
rm -rf /etc/ppp/options.xl2tpd
touch /etc/ppp/options.xl2tpd
cat >>/etc/ppp/options.xl2tpd<<EOF
require-mschap-v2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
asyncmap 0
auth
crtscts
lock
hide-password
modem
debug
name l2tpd
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
EOF
cat >>/etc/ppp/chap-secrets<<EOF
test l2tpd test123 *
EOF
touch /usr/bin/zl2tpset
echo "#/bin/bash" >>/usr/bin/zl2tpset
echo "for each in /proc/sys/net/ipv4/conf/*" >>/usr/bin/zl2tpset
echo "do" >>/usr/bin/zl2tpset
echo "echo 0 > \$each/accept_redirects" >>/usr/bin/zl2tpset
echo "echo 0 > \$each/send_redirects" >>/usr/bin/zl2tpset
echo "done" >>/usr/bin/zl2tpset
chmod +x /usr/bin/zl2tpset
iptables --table nat --append POSTROUTING --jump MASQUERADE
zl2tpset
xl2tpd
cat >>/etc/rc.local<<EOF
iptables --table nat --append POSTROUTING --jump MASQUERADE
/etc/init.d/ipsec restart
/usr/bin/zl2tpset
/usr/local/sbin/xl2tpd
EOF
clear
ipsec verify
printf "
####################################################
#                                                  #
# This is a Shell-Based tool of l2tp installation  #
# Version: 1.2                                     #
# Author: Zed Lau                                  #
# Website: http://zeddicus.com                     #
#                                                  #
####################################################
if there are no [FAILED] above, then you can
connect to your L2TP VPN Server with the default
user/pass below:

ServerIP:$vpsip
username:test
password:test123
PSK:$mypsk

"
---------------------------------------------------------------------------------------------------------------

Last modified onSunday, 14 October 2012 04:07

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0019413888{main}( ).../index.php:0
20.08084264464Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.08084264464Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.316011455584Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.316911479944Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.318111535272Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.318411562672require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.328511962304K2ControllerItem->execute( ).../k2.php:64
90.328511962304K2ControllerItem->display( ).../BaseController.php:710
100.337812613008K2ControllerItem->display( ).../item.php:78
110.337812613008K2ControllerItem->display( ).../controller.php:19
120.342312984048Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.344313004416K2ViewItem->display( ).../ViewController.php:102
140.429015915944K2ViewItem->display( ).../view.html.php:742
150.429015915944K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.431716088880include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
  • Published in VPN
  • Read 4187 times

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0019413888{main}( ).../index.php:0
20.08084264464Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.08084264464Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.316011455584Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.316911479944Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.318111535272Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.318411562672require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.328511962304K2ControllerItem->execute( ).../k2.php:64
90.328511962304K2ControllerItem->display( ).../BaseController.php:710
100.337812613008K2ControllerItem->display( ).../item.php:78
110.337812613008K2ControllerItem->display( ).../controller.php:19
120.342312984048Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.344313004416K2ViewItem->display( ).../ViewController.php:102
140.429015915944K2ViewItem->display( ).../view.html.php:742
150.429015915944K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.431716088880include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
Template Design © Joomla Templates | GavickPro. All rights reserved.