LNMP环境下安装freeradius,Freeradiux的安装配备

By admin in 美高梅手机版4858 on 2019年4月1日

1.安装web环境,使用LNMP一键安装包
现实安装步骤参考

LNMP环境下安装freeradius+radius manager3.9,lnmpfreeradius

1.装置web环境,使用LNMP一键安装包
切实安装步骤参考

2.安装到位后,安装LNMP缺乏的零部件
ionCube组件安装
进去lnmp解压后的目录,执行:./addons.sh install ionCube
回车确认后就会活动安装ionCube loader。

yum install perl-DBI

yum freeradius-mysql freeradius-utils

3.安装FreeRadius
wget

tar xvf freeradius-server-2.1.8-dmamod-1.tar.gz
cd freeradius-server-2.1.8
./configure
LNMP环境下安装freeradius,Freeradiux的安装配备。make
make install

4.文件全数者和权力配置
chmod 644 /usr/local/etc/raddb/dictionary
chown www /usr/local/etc/raddb
chown www /usr/local/etc/raddb/clients.conf

5.测试FreeRadius
radiusd -X
出现错误
“error while loading shared libraries:libfreeradius-radius-2.1.8.so:
cannot open shared object file : no such file or directory.”

运用的消除方法是将/usr/local/lib添加到/etc/ld.so.conf中

ld.so.conf文件内容如下:
include /etc/ld.so.conf.d/*.conf
加上一行 /usr/local/lib
成功后输入/sbin/ldconfig,再另行展开下面步骤。
Ldconfig命令是将/etc/ld.so.conf列出的路子下的库文件缓存到/etc/ld.

在此命令调试radiusd -X
并发错误
Failed binding to authentication address * port 1812: Address already
in use
/usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for
0.0.0.0 port 1812

端口占用难点.
运用命令lsof -i:1812
得到
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
radiusd 11163 radiusd 5u IPv4 949974 0t0 UDP *:radius
发现如故是radius自己占据了

拍卖办法(暴力点)
kill 11163(radius进度的PID,centos查看进程PID命令:ps -ef)
如觉察没有那几个命令可以使用yum install psmisc举办设置

再次radiusd -X调试
显示Ready to process requests.

Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /usr/local/var/run/radiusd/radiusd.sock
Listening on proxy address * port 1814
Ready to process requests.

到那边freeradius已经设置成功了

6.对freeradius详细配置,因为大家须要和PAJEROM整合,那里就须求详细的配置radius文件
首先说美素佳儿(Friso)下在使用LNMP环境包,也足以不难的设置freeradius,简单安装步骤如下
运用命令:yum install perl-DBI freeradius freeradius-mysql
freeradius-utils

可以一步到位安装好radius,小编个人提议采纳安装包一步步安装,那样发现题目得以每五日找到难点并缓解

对于配置radius文件有三种方法:

A:简单的点子运用glzjin(赵一初心)写好的公文一贯覆盖
wget -O
/etc/raddb/radiusd.conf
wget -O
/etc/raddb/sites-enabled/default
wget -O
/etc/raddb/sql/mysql/dialup.conf
wget -O
/etc/raddb/dictionary
wget -O
/etc/raddb/sql/mysql/counter.conf

B:详细的手动配置如下
#编辑/usr/local/etc/raddb/radiusd.conf文件

vi /usr/local/etc/raddb/radiusd.conf
查找”allow_vulnerabel_openssl = no”改为yes
查找” $INCLUDE sql.conf”(743行),去掉#号
查找” $INCLUDE sql/mysql/counter.conf”(712行),去掉#号

#清空/usr/local/etc/raddb/sites-enabled/default文件,间接把已经铺排好的文书内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/default
vi /usr/local/etc/raddb/sites-enabled/default

#清空/usr/local/etc/raddb/sites-enabled/inner-tunnel文件,直接把曾经布署好的文书内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/inner-tunnel
vi /usr/local/etc/raddb/sites-enabled/inner-tunnel

#编辑/usr/local/etc/raddb/eap.conf,修改MD5验证情势为peap情势
vi /usr/local/etc/raddb/eap.conf
第30行default_eap_type = md5改为default_eap_type = peap

#编辑/usr/local/etc/raddb/modules/mschap文件,修改为如下内容
vi /usr/local/etc/raddb/modules/mschap
mschap { use_mppe = yes require_encryption = yes require_strong = yes
}

#编辑/usr/local/etc/raddb/sql/mysql/dialup.conf文件
vi /usr/local/etc/raddb/sql/mysql/dialup.conf

查找simul_count_query将279-282行注释去掉,打开simul_count_query函数

#编辑/usr/local/etc/raddb/sql/mysql/counter.conf文件,添加自定义总结函数
monthlytrafficcounter(每月总计流量) 和
yearlytrafficcounter(每年总括流量)
vi /usr/local/etc/raddb/sql/mysql/counter.conf

在最终插手
sqlcounter monthlytrafficcounter {
counter-name = Monthly-Traffic
check-name = Max-Monthly-Traffic
reply-name = Monthly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = monthly
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 30 day)”
}

sqlcounter yearlytrafficcounter {
counter-name = Yearly-Traffic
check-name = Max- Yearly-Traffic
reply-name = Yearly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = never
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 365 day)”
}

#编纂字典文件/usr/local/etc/raddb/dictionary
vi /usr/local/etc/raddb/dictionary

#累加以下内容
ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer
ATTRIBUTE Acct-Interim-Interval 85 integer
ATTRIBUTE Max-Yearly-Traffic 3003 integer
ATTRIBUTE Yearly-Traffic-Limit 3004 integer

7.建立MySql相关的数据库并作设置
三种办法如下:
A。使用phpmyadmin建立
LNMP环境下带phpmyadmin,
建立多少个数据库radius和conntrack
跻身后点:账号—新增用户账号
填写好用户名和密码,一定点击(用户账号数据库下的创办与用户同名的数据库并给予全部权限。)

B。使用ssh登陆命令建立
mysql -u root -p密码 #签到mysql,超级账号root和密码
CREATE DATABASE radius; #创建radius数据库
CREATE DATABASE conntrack; #创建conntrack数据库
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123′;
#创设用户radius,密码radius123
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123′;
#创立用户conntrack,密码conn123
GRANT ALL ON radius.* TO
[email protected];
#给radius数据库设置访问权限
GRANT ALL ON conntrack.* TO
[email protected];
#给conntrack数据库设置访问权限

8.配置freeradius数据库
/usr/local/etc/raddb/sql.conf #使用radius/radius123
# Connection info:
server = “localhost”
#port = 3306
login = “radius”
password = “radius123″

找到readclients一行,设为yes并去掉注释符号#

此地要专门说美素佳儿(Friso)下,要是在装置freeraduis是运用的是第5点里yun间接设置的话,那么sql.conf这一个文件
在/etc/raddb/sql.conf 这些目录里。

9.关闭SELINUX(需重启机器生效)
/etc/sysconfig/selinux
SELINUX=disabled

10.修改机器MAC地址,因为自个儿下载TiggoM3.9本子是破解的,授权文件和MAC地址都以破解者公布的(供给重启生效PS:昂CoraM4.16是或不是也足以应用相同措施处理,有色金属商讨所究出来的对象,能够和自作者调换一下)

不能够利用这一个命令:ifconfig eth0
down(禁止使用网卡),你是ssh链接的利用了这一个,你霎时就掉线了,不用作者说原因呢。

正确的格局:
使用winscp下载 /etc/sysconfig/network-scripts里ifcfg-eth0

修改当中的”HWADDRAV4=xx:xx:xx:xx:xx:xx”为”MACADD奥德赛=00:D0:09:B8:B7:34″

上传覆盖,重启机器未来生效。

11.安装Radius Manager

第壹为Radius Manager建立1个web

行使lnmp vhost
add,本次不供给创制mysql数据库了,在地点大家早就创建好了。

使用winscp上传radiusmanager-3.9.0.tar.gz到root目录
tar zxvf radiusmanager-3.9.0.tar.gz
cd radiusmanager-3.9.0
chmod 755 install.sh
./install.sh

出现Radius Manager installer
Copyright 2004-2011, DMA Softlab LLC
All right reserved.
(Use CTRL+C to abort any time)
Select the type of your operating system:

  1. Redhat (Fedora, CentOS etc.)
  2. Debian (Ubuntu etc.)
    Choose an option: [1](我的是centos系统)

Selected operating system is: REDHAT
Select installation type:

  1. New installation
  2. Upgrade old system
    Choose an option: [1](全新安装)

Selected installation method: NEW INSTALLATION
WWW root path: [/var/www/html]
那里改成大家树立的web目录/home/wwwroot/你的域名
RADIUS database host: [localhost]
RADIUS database username: [radius] #使用radius
RADIUS database password: [radius123] 你建立的radius数据库的密码
CTS database host: [localhost]
CTS database username: [conntrack] #使用conntrack
CTS database password: [conn123] 你建立的conntrack的密码
Freeradius UNIX user: [root] #使用root
Httpd UNIX user: [apache] 改成WWW
Create rmpoller service: [y]
Create rmconntrack service: [y]
Back up RADIUS database: [y]
WARNING! If You continue You will overwrite the existing RADIUS
database!
Are You sure to start the installation? [n] y
Starting installation process…
Copying WEB content to /home/wwwroot/你的域名/radiusmanager
Copying binaries to /usr/local/bin
Copying rootexec to /usr/local/sbin
Copying radiusmanager.cfg to /etc
Backing up RADIUS database…
Creating MySQL tables
Creating rmpoller service
Creating rmconntrack service
Copying logrotate script
Setting permission on raddb files
Copying radiusd init script to /etc/init.d
Installation finished!

12.修改凯雷德M配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

13.修改酷路泽M文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

14.修改目录文件权限
chattr -i /home/wwwroot/你的域名/.user.ini
chown www:www -Lacrosse /home/wwwroot/你的域名
chmod -奥迪Q7 777 /home/wwwroot/你的域名
chmod 755 /usr/local/bin/rmauth
chmod 755 /usr/local/bin/rmacnt
chmod 755 /usr/local/bin/rmpoller
chmod 600 /etc/radiusmanager.cfg
chmod 755 /usr/local/bin/rmconntrack
chmod 4755 /usr/local/sbin/rootexec

重启服务器。访问地址 账号admin 密码1111
用户访问地址 账号user 密码1111

 

manager3.9,lnmpfreeradius 1.安装web环境,使用LNMP一键安装包
具体安装步骤参考 2.安装实现后…

1.设置web环境,使用LNMP一键安装包
具体安装步骤参考

VPN:PPTP+MySQL+Freeradiux的设置配置MySQL存款和储蓄vpn帐号Freeradiux验证vpn帐号1.安装ppp2.安装pptp配置文件如下:#vimoptions.pptpdnamepptpdrefuse-paprefuse-chaprefuse-mschaprequire-mschap-v2require-mppe-128proxyarplocknobsdcompnovjnovjccompnologfdms-dns218.85.157.99ms-dns218.85.152.99plugin/usr/local/ppp/lib/pppd/2.4.4/radius.soplugin/usr/local/ppp/lib/pppd/2.4.4/radattr.soradius-config-file/usr/local/freeradius/etc/radiusclient/radiusclient.conf#vimpptpd.confoption/usr/local/pptpd/etc/options.pptpdlocalip192.168.100.100remoteip192.168.100.150-200黄底为新加布局内容。3.装置mysql4.设置freeradius#wgetftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.1.10.tar.gz#美高梅手机版4858,tarzxvpffreeradius-server-2.1.10.tar.gz-C../software#./configure–prefix=/usr/local/freeradius#make#makeinstall#makdir/usr/local/freeradius/etc/radiusclient#cp/usr/local/src/tarbag/ppp-2.4.4/pppd/plugins/radius/etc/*\/usr/local/freeradius/etc/radiusclient#chown-Rradiusd.radiusd/usr/local/freeradius#vimservers//修改key#ServerNameorClient/ServerpairKey#——————————-#localhosttesting123localhost
vpn#/usr/local/freeradius/sbin/radiusd-X//此进度会生产证书倘诺要修改key首先要去除在此以前的证书文件#cd/usr/local/freeradius/etc/raddb/certs#rm-rf*.pem*.der*.csr*.crt*.key*.p12serial*index.txt*5.关联mysql文件在那几个目录下/usr/local/freeradius/etc/raddb/sql/mysql,包含部分授权命令都写好了。>createdatabasevpn>source/usr/local/freeradius/etc/raddb/sql/mysql/schema.sql>source/usr/local/freeradius/etc/raddb/sql/mysql/nas.sql>source/usr/local/freeradius/etc/raddb/sql/mysql/ippool.sql>source/usr/local/freeradius/etc/raddb/sql/mysql/wimax.sql>grantselect,insert,update,deleteon`vpn`.*to’user’@’x.x.x.x’identifiedby’password’>insertintoradgroupreply(groupname,attribute,op,value)\values(‘user’,’Auth-Type’,’:=’,’Local’)>insertintoradgroupreply(groupname,attribute,op,value)\values(‘user’,’Service-Type’,’=’,’Framed-User’)>insertintoradgroupreply(groupname,attribute,op,value)\values(‘user’,’Framed-IP-Netmask’,’=’,’255.255.255.255′)>insertintoradgroupreply(groupname,attribute,op,value)\values(‘user’,’Framed-IP-Netmask’,’:=’,’255.255.255.0′)>insertintoradcheck(UserName,Attribute,Value)\values(‘test’,’User-Password’,’123456)>insertintoradusergroup(username,groupname)values(‘test’,’user’)>insertintoradgroupcheck(groupname,attribute,op,value)\Values(‘user’,’simultaneous-use’,’:=’,’1′)//限制同一帐号同时只同意登录3次>insertintoradreply(username,attribute,op,value)\values(‘vpnname’,’Framed-IP-Address’,’:=’,’xxx.xxx.xxx.xxx’)//分配固定IP6.连接数据库#vim/usr/local/freeradius/etc/raddb/sql.conf修改数据库类型;数据库地址;用户名;密码;数据库名;数据表名#readclients=yes前面的#去掉7.开启sql模块#/usr/local/freeradius/etc/raddb/sites-enabled/defaultfiles行后面加#sql行前边去掉##/usr/local/freeradius/etc/raddb/sites-enabled/inner-tunnelfiles行前面加#sql行前边去掉#8.修改eap类型#vim/usr/local/freeradius/etc/raddb/eap.confdefalt_eap_type=md5改为default_eap_type=peap9.修改相应的门路#vim/usr/local/freeradius/etc/radiusclient/radiusclient.conf/usr/local/etc/改为/usr/local/freeradius/etc/10.修改radius以radiusd用户运维#/usr/local/freeradius/etc/raddb/radiusd.confuser=radiusdgroup=radiusd11.修改clients.conf#/usr/local/freeradius/etc/raddb/clients.confsecret=vpnclient192.168.100.0/24{secret=vpnshortname=vpn-network}12.修改dictionary#/usr/local/freeradius/etc/radiusclient/dictionaryINCLUDE/usr/local/freeradius/etc/radiusclient/dictionary.microsoftINCLUDE/usr/local/freeradius/etc/radiusclient/dictionary.ascendINCLUDE/usr/local/freeradius/etc/radiusclient/dictionary.meritINCLUDE/usr/local/freeradius/etc/radiusclient/dictionary.compat13.测试帐号##/usr/local/freeradius/bin/radtesttest123456localhost1812vpnSendingAccess-Requestofid7to127.0.0.1port1812User-Name=”JSB_TEST_11″User-Password=”ABC1234567890?aaa”NAS-IP-Address=127.0.0.1NAS-Port=1812rad_recv:Access-Acceptpacketfromhost127.0.0.1port1812,id=7,length=32Service-Type=Framed-UserFramed-IP-Netmask=255.255.255.0并发access-accept帐号可以动用不自然能够登录(比如禁止使用帐号后证实是由此的只是不能够登录的),出现Access-Reject则战败。===========================================================ppp/pptp日志的分开#vim/etc/syslog.confdaemon.*/var/log/ppp.log#serviesyslogrestart拨上VPN后有的网站内容呈现不全或打不开原因及消除办法:美高梅手机版4858 1美高梅手机版4858 2美高梅手机版4858 3mtu:马克西tumTransmissionUnit最大传输单元mss:马克西tumSegmentSize最大分段大小mtumss(应用层数据)+tcp廊坊+IP上饶mss大小是通讯双方在确立TCP连接时遵照双方提供的MSS值的最小值分明为这一次几次三番的最大MSS值tcp数据包洛阳大小20Byteip数据包咸阳大小20Byte如果超越mtu的大大小小就须求对ip报文实行分片。借使ip报文中有DF(DonotFragment)标记就象征不可分片。假使报文超越MTU值又不能够分片,就会废弃报文,再次回到1个荒谬消息unreachable-needtofrag(不可到达,需要分片)。化解办法:iptables-AFO索罗德WA奥迪Q3D-ptcp–syn-s192.168.100.0/24-jTCPMSS–set-mss1356凡是来自192.168.100.0/24网段的tcp包,mss设置为1356.

2.设置实现后,安装LNMP缺乏的零部件
ionCube组件安装
进去lnmp解压后的目录,执行:./addons.sh install ionCube
回车确认后就会活动安装ionCube loader。

2.装置到位后,安装LNMP贫乏的零件
ionCube组件安装
跻身lnmp解压后的目录,执行:./addons.sh install ionCube
回车确认后就会自行安装ionCube loader。

yum install perl-DBI

yum install perl-DBI

yum freeradius-mysql freeradius-utils

yum freeradius-mysql freeradius-utils

3.安装FreeRadius
wget

tar xvf freeradius-server-2.1.8-dmamod-1.tar.gz
cd freeradius-server-2.1.8
./configure
make
make install

3.安装FreeRadius
wget

tar xvf freeradius-server-2.1.8-dmamod-1.tar.gz
cd freeradius-server-2.1.8
./configure
make
make install

4.文书全部者和权杖配置
chmod 644 /usr/local/etc/raddb/dictionary
chown www /usr/local/etc/raddb
chown www /usr/local/etc/raddb/clients.conf

4.文书全部者和权限配置
chmod 644 /usr/local/etc/raddb/dictionary
chown www /usr/local/etc/raddb
chown www /usr/local/etc/raddb/clients.conf

5.测试FreeRadius
radiusd -X
并发谬误
“error while loading shared libraries:libfreeradius-radius-2.1.8.so:
cannot open shared object file : no such file or directory.”

5.测试FreeRadius
radiusd -X
出现错误
“error while loading shared libraries:libfreeradius-radius-2.1.8.so:
cannot open shared object file : no such file or directory.”

行使的化解措施是将/usr/local/lib添加到/etc/ld.so.conf中

使用的消除办法是将/usr/local/lib添加到/etc/ld.so.conf中

ld.so.conf文件内容如下:
include /etc/ld.so.conf.d/*.conf
添加一行 /usr/local/lib
成功后输入/sbin/ldconfig,再另行展开上边步骤。
Ldconfig命令是将/etc/ld.so.conf列出的门路下的库文件缓存到/etc/ld.

ld.so.conf文件内容如下:
include /etc/ld.so.conf.d/*.conf
拉长一行 /usr/local/lib
做到后输入/sbin/ldconfig,再重复开始展览下面步骤。
Ldconfig命令是将/etc/ld.so.conf列出的路子下的库文件缓存到/etc/ld.

在此命令调节和测试radiusd -X
并发错误
Failed binding to authentication address * port 1812: Address already
in use
/usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for
0.0.0.0 port 1812

在此命令调节和测试radiusd -X
并发谬误
Failed binding to authentication address * port 1812: Address already
in use
/usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for
0.0.0.0 port 1812

端口占用难题.
使用命令lsof -i:1812
得到
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
radiusd 11163 radiusd 5u IPv4 949974 0t0 UDP *:radius
发现依然是radius本人占据了

端口占用难题.
动用命令lsof -i:1812
得到
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
radiusd 11163 radiusd 5u IPv4 949974 0t0 UDP *:radius
察觉竟然是radius自身占有了

拍卖措施(暴力点)
kill 11163(radius进度的PID,centos查看进度PID命令:ps -ef)
如发现并未这一个命令能够使用yum install psmisc实行安装

拍卖措施(暴力点)
kill 11163(radius进度的PID,centos查看进度PID命令:ps -ef)
如发现没有那几个命令能够使用yum install psmisc进行设置

再次radiusd -X调试
显示Ready to process requests.

再次radiusd -X调试
显示Ready to process requests.

Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /usr/local/var/run/radiusd/radiusd.sock
Listening on proxy address * port 1814
Ready to process requests.

Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /usr/local/var/run/radiusd/radiusd.sock
Listening on proxy address * port 1814
Ready to process requests.

到此地freeradius已经设置成功了

到那里freeradius已经设置成功了

6.对freeradius详细配置,因为大家要求和库罗德M整合,那里就需求详细的配置radius文件
先是表明一(Wissu)下在运用LNMP环境包,也能够差不多的安装freeradius,不难安装步骤如下
利用命令:yum install perl-DBI freeradius freeradius-mysql
freeradius-utils

6.对freeradius详细配置,因为大家要求和中华VM整合,这里就须要详细的配置radius文件
第叁说美素佳儿(Friso)下在选取LNMP环境包,也足以回顾的安装freeradius,简单安装步骤如下
选取命令:yum install perl-DBI freeradius freeradius-mysql
freeradius-utils

能够一步到位安装好radius,小编个人建议选用安装包一步步装置,那样发现标题能够随时找到难点并缓解

能够一步到位安装好radius,作者个人指出利用安装包一步步设置,那样发现标题得以每日找到难题并缓解

对于配置radius文件有二种艺术:

对此配置radius文件有三种办法:

A:简单的不二法门应用glzjin(赵一初心)写好的文书一向覆盖
wget -O
/etc/raddb/radiusd.conf
wget -O
/etc/raddb/sites-enabled/default
wget -O
/etc/raddb/sql/mysql/dialup.conf
wget -O
/etc/raddb/dictionary
wget -O
/etc/raddb/sql/mysql/counter.conf

A:不难的点子运用glzjin(赵一初心)写好的文本一直覆盖
wget -O
/etc/raddb/radiusd.conf
wget -O
/etc/raddb/sites-enabled/default
wget -O
/etc/raddb/sql/mysql/dialup.conf
wget -O
/etc/raddb/dictionary
wget -O
/etc/raddb/sql/mysql/counter.conf

B:详细的手动配置如下
#编辑/usr/local/etc/raddb/radiusd.conf文件

B:详细的手动配置如下
#编辑/usr/local/etc/raddb/radiusd.conf文件

vi /usr/local/etc/raddb/radiusd.conf
查找”allow_vulnerabel_openssl = no”改为yes
查找” $INCLUDE sql.conf”(743行),去掉#号
查找” $INCLUDE sql/mysql/counter.conf”(712行),去掉#号

vi /usr/local/etc/raddb/radiusd.conf
查找”allow_vulnerabel_openssl = no”改为yes
查找” $INCLUDE sql.conf”(743行),去掉#号
查找” $INCLUDE sql/mysql/counter.conf”(712行),去掉#号

#清空/usr/local/etc/raddb/sites-enabled/default文件,直接把已经布置好的公文内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/default
vi /usr/local/etc/raddb/sites-enabled/default

#清空/usr/local/etc/raddb/sites-enabled/default文件,直接把曾经陈设好的文件内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/default
vi /usr/local/etc/raddb/sites-enabled/default

#清空/usr/local/etc/raddb/sites-enabled/inner-tunnel文件,直接把已经陈设好的文件内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/inner-tunnel
vi /usr/local/etc/raddb/sites-enabled/inner-tunnel

#清空/usr/local/etc/raddb/sites-enabled/inner-tunnel文件,间接把早已安顿好的文书内容复制进去保存
cat /dev/null > /usr/local/etc/raddb/sites-enabled/inner-tunnel
vi /usr/local/etc/raddb/sites-enabled/inner-tunnel

#编辑/usr/local/etc/raddb/eap.conf,修改MD5验证情势为peap情势
vi /usr/local/etc/raddb/eap.conf
第30行default_eap_type = md5改为default_eap_type = peap

#编辑/usr/local/etc/raddb/eap.conf,修改MD5验证格局为peap模式
vi /usr/local/etc/raddb/eap.conf
第30行default_eap_type = md5改为default_eap_type = peap

#编辑/usr/local/etc/raddb/modules/mschap文件,修改为如下内容
vi /usr/local/etc/raddb/modules/mschap
mschap { use_mppe = yes require_encryption = yes require_strong = yes
}

#编辑/usr/local/etc/raddb/modules/mschap文件,修改为如下内容
vi /usr/local/etc/raddb/modules/mschap
mschap { use_mppe = yes require_encryption = yes require_strong = yes
}

#编辑/usr/local/etc/raddb/sql/mysql/dialup.conf文件
vi /usr/local/etc/raddb/sql/mysql/dialup.conf

#编辑/usr/local/etc/raddb/sql/mysql/dialup.conf文件
vi /usr/local/etc/raddb/sql/mysql/dialup.conf

查找simul_count_query将279-282行注释去掉,打开simul_count_query函数

查找simul_count_query将279-282行注释去掉,打开simul_count_query函数

#编辑/usr/local/etc/raddb/sql/mysql/counter.conf文件,添加自定义计算函数
monthlytrafficcounter(每月总计流量) 和
yearlytrafficcounter(每年总括流量)
vi /usr/local/etc/raddb/sql/mysql/counter.conf

#编辑/usr/local/etc/raddb/sql/mysql/counter.conf文件,添加自定义总结函数
monthlytrafficcounter(每月计算流量) 和
yearlytrafficcounter(每年总计流量)
vi /usr/local/etc/raddb/sql/mysql/counter.conf

在终极参预
sqlcounter monthlytrafficcounter {
counter-name = Monthly-Traffic
check-name = Max-Monthly-Traffic
reply-name = Monthly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = monthly
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 30 day)”
}

在最终参与
sqlcounter monthlytrafficcounter {
counter-name = Monthly-Traffic
check-name = Max-Monthly-Traffic
reply-name = Monthly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = monthly
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 30 day)”
}

sqlcounter yearlytrafficcounter {
counter-name = Yearly-Traffic
check-name = Max- Yearly-Traffic
reply-name = Yearly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = never
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 365 day)”
}

sqlcounter yearlytrafficcounter {
counter-name = Yearly-Traffic
check-name = Max- Yearly-Traffic
reply-name = Yearly-Traffic-Limit
sqlmod-inst = sql
key = User-Name
reset = never
query = ” SELECT ABS(SUM(acctinputoctets + acctoutputoctets) DIV
1048576) FROM radacct WHERE UserName=’%{%k}’ AND AcctStartTime >=
date_sub(curdate(),interval 365 day)”
}

#编排字典文件/usr/local/etc/raddb/dictionary
vi /usr/local/etc/raddb/dictionary

#编纂字典文件/usr/local/etc/raddb/dictionary
vi /usr/local/etc/raddb/dictionary

#添加以下内容
ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer
ATTRIBUTE Acct-Interim-Interval 85 integer
ATTRIBUTE Max-Yearly-Traffic 3003 integer
ATTRIBUTE Yearly-Traffic-Limit 3004 integer

#拉长以下内容
ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer
ATTRIBUTE Acct-Interim-Interval 85 integer
ATTRIBUTE Max-Yearly-Traffic 3003 integer
ATTRIBUTE Yearly-Traffic-Limit 3004 integer

7.确立MySql相关的数据库并作设置
二种办法如下:
A。使用phpmyadmin建立
LNMP环境下带phpmyadmin,
建立三个数据库radius和conntrack
进去后点:账号—新增用户账号
填写好用户名和密码,一定点击(用户账号数据库下的创造与用户同名的数据库并给予全部权力。)

7.手无寸铁MySql相关的数据库并作设置
三种艺术如下:
A。使用phpmyadmin建立
LNMP环境下带phpmyadmin,
创制几个数据库radius和conntrack
进入后点:账号—新增用户账号
填写好用户名和密码,一定点击(用户账号数据库下的创办与用户同名的数据库并给予全数权限。)

B。使用ssh登陆命令建立
mysql -u root -p密码 #签到mysql,超级账号root和密码
CREATE DATABASE radius; #创建radius数据库
CREATE DATABASE conntrack; #创建conntrack数据库
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123′;
#始建用户radius,密码radius123
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123′;
#创设用户conntrack,密码conn123
GRANT ALL ON radius.* TO radius@localhost;
#给radius数据库设置访问权限
GRANT ALL ON conntrack.* TO conntrack@localhost;
#给conntrack数据库设置访问权限

B。使用ssh登陆命令建立
mysql -u root -p密码 #报到mysql,顶尖账号root和密码
CREATE DATABASE radius; #创建radius数据库
CREATE DATABASE conntrack; #创建conntrack数据库
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123′;
#制造用户radius,密码radius123
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123′;
#创设用户conntrack,密码conn123
GRANT ALL ON radius.* TO radius@localhost;
#给radius数据库设置访问权限
GRANT ALL ON conntrack.* TO conntrack@localhost;
#给conntrack数据库设置访问权限

8.配置freeradius数据库
/usr/local/etc/raddb/sql.conf #使用radius/radius123
# Connection info:
server = “localhost”
#port = 3306
login = “radius”
password = “radius123″

8.配置freeradius数据库
/usr/local/etc/raddb/sql.conf #使用radius/radius123
# Connection info:
server = “localhost”
#port = 3306
login = “radius”
password = “radius123″

找到readclients一行,设为yes并去掉注释符号#

找到readclients一行,设为yes并去掉注释符号#

此地要尤其说美赞臣(Meadjohnson)下,固然在装置freeraduis是应用的是第六点里yun直接设置的话,那么sql.conf那个文件
在/etc/raddb/sql.conf 那一个目录里。

这里要尤其说爱他美(Aptamil)下,即使在装置freeraduis是利用的是第4点里yun直接设置的话,那么sql.conf那么些文件
在/etc/raddb/sql.conf 这几个目录里。

9.关闭SELINUX(需重启机器生效)
/etc/sysconfig/selinux
SELINUX=disabled

9.关闭SELINUX(需重启机器生效)
/etc/sysconfig/selinux
SELINUX=disabled

10.修改机器MAC地址,因为本身下载LX570M3.9本子是破解的,授权文件和MAC地址都以破解者公布的(要求重启生效PS:ENVISIONM4.16是还是不是也足以动用相同措施处理,有色金属研讨所究出来的爱人,能够和我沟通一下)

10.改动机器MAC地址,因为笔者下载KoleosM3.9本子是破解的,授权文件和MAC地址都是破解者发表的(供给重启生效PS:RAV4M4.16是否也足以应用同一办法处理,有色金属讨论所究出来的心上人,能够和自笔者交换一下)

不能选择这几个命令:ifconfig eth0
down(禁止使用网卡),你是ssh链接的利用了这么些,你霎时就掉线了,不用自身说原因呢。

不能够采取这么些命令:ifconfig eth0
down(禁止使用网卡),你是ssh链接的应用了那几个,你即刻就掉线了,不用小编说原因吧。

科学的法门:
使用winscp下载 /etc/sysconfig/network-scripts里ifcfg-eth0

是的的措施:
使用winscp下载 /etc/sysconfig/network-scripts里ifcfg-eth0

修改当中的”HWADD库罗德=xx:xx:xx:xx:xx:xx”为”MACADD悍马H2=00:D0:09:B8:B7:34″

修改当中的”HWADD福特Explorer=xx:xx:xx:xx:xx:xx”为”MACADDSportage=00:D0:09:B8:B7:34″

上传覆盖,重启机器以往生效。

上传覆盖,重启机器今后生效。

11.安装Radius Manager

11.安装Radius Manager

率先为Radius Manager建立多个web

先是为Radius Manager建立3个web

动用lnmp vhost
add,本次不供给创建mysql数据库了,在上边大家已经创办好了。

选取lnmp vhost
add,这一次不要求创立mysql数据库了,在地点我们曾经创制好了。

使用winscp上传radiusmanager-3.9.0.tar.gz到root目录
tar zxvf radiusmanager-3.9.0.tar.gz
cd radiusmanager-3.9.0
chmod 755 install.sh
./install.sh

使用winscp上传radiusmanager-3.9.0.tar.gz到root目录
tar zxvf radiusmanager-3.9.0.tar.gz
cd radiusmanager-3.9.0
chmod 755 install.sh
./install.sh

出现Radius Manager installer
Copyright 2004-2011, DMA Softlab LLC
All right reserved.
(Use CTRL+C to abort any time)
Select the type of your operating system:

出现Radius Manager installer
Copyright 2004-2011, DMA Softlab LLC
All right reserved.
(Use CTRL+C to abort any time)
Select the type of your operating system:

  1. Redhat (Fedora, CentOS etc.)
  2. Debian (Ubuntu etc.)
    Choose an option: [1](我的是centos系统)
  1. Redhat (Fedora, CentOS etc.)
  2. Debian (Ubuntu etc.)
    Choose an option: [1](我的是centos系统)

Selected operating system is: REDHAT
Select installation type:

Selected operating system is: REDHAT
Select installation type:

  1. New installation
  2. Upgrade old system
    Choose an option: [1](全新安装)
  1. New installation
  2. Upgrade old system
    Choose an option: [1](全新安装)

Selected installation method: NEW INSTALLATION
WWW root path: [/var/www/html]
那里改成大家创建的web目录/home/wwwroot/你的域名
RADIUS database host: [localhost]
RADIUS database username: [radius] #使用radius
RADIUS database password: [radius123] 你建立的radius数据库的密码
CTS database host: [localhost]
CTS database username: [conntrack] #使用conntrack
CTS database password: [conn123] 你建立的conntrack的密码
Freeradius UNIX user: [root] #使用root
Httpd UNIX user: [apache] 改成WWW
Create rmpoller service: [y]
Create rmconntrack service: [y]
Back up RADIUS database: [y]
WARNING! If You continue You will overwrite the existing RADIUS
database!
Are You sure to start the installation? [n] y
Starting installation process…
Copying WEB content to /home/wwwroot/你的域名/radiusmanager
Copying binaries to /usr/local/bin
Copying rootexec to /usr/local/sbin
Copying radiusmanager.cfg to /etc
Backing up RADIUS database…
Creating MySQL tables
Creating rmpoller service
Creating rmconntrack service
Copying logrotate script
Setting permission on raddb files
Copying radiusd init script to /etc/init.d
Installation finished!

Selected installation method: NEW INSTALLATION
WWW root path: [/var/www/html]
那里改成大家树立的web目录/home/wwwroot/你的域名
RADIUS database host: [localhost]
RADIUS database username: [radius] #使用radius
RADIUS database password: [radius123] 你建立的radius数据库的密码
CTS database host: [localhost]
CTS database username: [conntrack] #使用conntrack
CTS database password: [conn123] 你建立的conntrack的密码
Freeradius UNIX user: [root] #使用root
Httpd UNIX user: [apache] 改成WWW
Create rmpoller service: [y]
Create rmconntrack service: [y]
Back up RADIUS database: [y]
WARNING! If You continue You will overwrite the existing RADIUS
database!
Are You sure to start the installation? [n] y
Starting installation process…
Copying WEB content to /home/wwwroot/你的域名/radiusmanager
Copying binaries to /usr/local/bin
Copying rootexec to /usr/local/sbin
Copying radiusmanager.cfg to /etc
Backing up RADIUS database…
Creating MySQL tables
Creating rmpoller service
Creating rmconntrack service
Copying logrotate script
Setting permission on raddb files
Copying radiusd init script to /etc/init.d
Installation finished!

12.修改安德拉M配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

12.修改福睿斯M配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

13.修改LacrosseM文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

13.修改酷威M文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

14.改动目录文件权限
chattr -i /home/wwwroot/你的域名/.user.ini
chown www:www -奥迪Q7 /home/wwwroot/你的域名
chmod -Highlander 777 /home/wwwroot/你的域名
chmod 755 /usr/local/bin/rmauth
chmod 755 /usr/local/bin/rmacnt
chmod 755 /usr/local/bin/rmpoller
chmod 600 /etc/radiusmanager.cfg
chmod 755 /usr/local/bin/rmconntrack
chmod 4755 /usr/local/sbin/rootexec

14.改动目录文件权限
chattr -i /home/wwwroot/你的域名/.user.ini
chown www:www -QX56 /home/wwwroot/你的域名
chmod -ENCORE 777 /home/wwwroot/你的域名
chmod 755 /usr/local/bin/rmauth
chmod 755 /usr/local/bin/rmacnt
chmod 755 /usr/local/bin/rmpoller
chmod 600 /etc/radiusmanager.cfg
chmod 755 /usr/local/bin/rmconntrack
chmod 4755 /usr/local/sbin/rootexec

重启服务器。访问地址 账号admin 密码1111
用户访问地址 账号user 密码1111

重启服务器。访问地址 账号admin 密码1111
用户访问地址 账号user 密码1111

 

 

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有