PPTP,L2TP,OpenVPN之VPN三合一安装包
2011年8月5日
| 分类: Linux, VPN
| 标签: centos, Freeradius, l2tp, Linux, lnmp, mysql, OpenVPN, pptp, sh, shell, VPN, vpn三合一安装包, 三合一安装包, 快速安装系列
#注意本地址在墙外,安装中断可以用screen -r vpn恢复,生产环境谨慎使用 yum -y install screen screen -S vpn wget -c http://nchc.dl.sourceforge.net/project/vpn3in1/vpn3in1.tar.gz tar zxvf vpn3in1.tar.gz ./vpn3in1.sh 2>&1 | tee vpn3in1.log
2014.1.20修复openvpn生成证书错误;
2012.8.25更新:本地完整安装包;
2012.3.19更新:添加对自定义下载安装包地址的支持;
2011.8.5更新:添加对centos 6.0支持;
2011.7.2更新:添加验证已安装mysql的root用户密码是否正确;添加Daloradius,RadiusManager,apache。详细安装可以看图示;
2011.5.8更新:添加可选使用本机freeradius服务或者使用远程freeradius服务器,如果使用远程则不会在本机安装freeradius及mysql服务;
提高Mysql是否安装识别,去除Nginx,phpMyAdmin,daloradius安装,这些功能建议单独安装,还原OPENVPN端口为1194。
已知问题:
1,可选RadiusManage是修改mac地址进行破解,如果vps不支持修改mac地址将导致无法连接。
2,L2TP不能记录callingstationid,OPENVPN使用UDP端口不能记录acctstoptime
根据palfans修改而成,http://www.palfans.net/3-in-1-vpn-package/
开启mysql远程帐号脚本
mysql -u root -proot; grant all on *.* to username@'%' identified by 'password'; flush privileges;
其中 all 指定相关的操作, *.*说明数据库和表名, username表示用户名,‘%’这里写Host名称,允许所有就用‘%’,‘password’是密码。这里改成相应的值后进行操作就可以开启远程帐号访问
修改VPN服务器radius认证为远程服务器
修改参数在VPN服务器运行下面脚本
radius_server="radius服务器IP" secret_key="yishanhome.com" etc_dir="/usr/local/etc" sed -i -e "s/name=127.0.0.1/name=$radius_server/" /etc/openvpn/radiusplugin.cnf sed -i -e "s/sharedsecret=testpw/sharedsecret=$secret_key/" /etc/openvpn/radiusplugin.cnf sed -i -e "s/localhost:1812/$radius_server:1812/" $etc_dir/radiusclient/radiusclient.conf sed -i -e "s/localhost:1813/$radius_server:1813/" $etc_dir/radiusclient/radiusclient.conf mv -f $etc_dir/radiusclient/servers $etc_dir/radiusclient/servers.bak cat >> $etc_dir/radiusclient/servers <<EOF $radius_server $secret_key EOF
修改参数在radius服务器运行下面脚本
client_ip="VPN服务器IP" secret_key="yishanhome.com" etc_dir="/usr/local/etc" iptables -A INPUT -i eth0 -p udp -s $client_ip --dport 1812 -j ACCEPT iptables -A INPUT -i eth0 -p udp -s $client_ip --dport 1813 -j ACCEPT cat >> $etc_dir/raddb/clients.conf <<EOF client localhost { ipaddr = $client_ip secret = $secret_key require_message_authenticator = no nastype = other } EOF
逸山大哥,想请问下配置好的openvpn怎样连接?配置文件,证书这些在哪个目录?
128M内存的VPS似乎无法安装? 总是提示无法连接数据库
cp -f $wd_work/openvpn-server.conf /etc/openvpn/server.conf
openvpn-server.conf 这个文件在哪?
表哥,求个联系方式。微信或者QQ
如何替换9.9流控 需要修改帮那些地方
逸山大哥,你可以出一下升级包那个 版本 0.9-8 升级成0.9-9
请问,为什么一键安装后,无法访问admin.php
@逸山
逸山大王,那个L2TP连接之后几秒之内是正常的,但是之后就无法上网了,VPN不断。这个是什么情况?我是远程radius认证的。希望逸山兄能帮帮我
我测试后提示
# radtest testing password 127.0.0.1 0 testing123
Sending Access-Request of id 30 to 127.0.0.1 port 1812
User-Name = “testing”
User-Password = “password”
NAS-IP-Address = 127.0.0.1
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
Sending Access-Request of id 30 to 127.0.0.1 port 1812
User-Name = “testing”
User-Password = “password”
NAS-IP-Address = 127.0.0.1
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
Sending Access-Request of id 30 to 127.0.0.1 port 1812
User-Name = “testing”
User-Password = “password”
NAS-IP-Address = 127.0.0.1
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
radclient: no response from server for ID 30 socket 3