虚拟化容器,大数据,DBA,中间件,监控。

PPTP,L2TP,OpenVPN之VPN三合一安装包

29 02月
作者:admin|分类:应用管理
#注意本地址在墙外,安装中断可以用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。
已知问题: 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
浏览2666 评论0
返回
目录
返回
首页
ESXI5.5 本地磁盘分区丢失/vSphere 5.x 和 6.x 中重新创建缺少的 VMFS 数据存储分区 (2088543) Cacti监控交换机,windows常见问题方法