1.设置web环境,使用LNMP1键安装包
实际安装步骤参考

LNMP环境下安装freeradius+radius manager三.玖,lnmpfreeradius

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

二.安装到位后,安装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
make
make install

四.文件全数者和权力配置
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
拉长1行 /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:181二
得到
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
radiusd 11163 radiusd 5u IPv4 949974 0t0 UDP *:radius
发现还是是radius自身占有了

拍卖方法(暴力点)
kill 111六三(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已经安装成功了

陆.对freeradius详细配置,因为大家需求和奥迪Q7M整合,那里就必要详细的配置radius文件
第二说圣元(Synutra)下在选取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将27玖-2八二行注释去掉,打开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

柒.确立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,密码radius1二3
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并去掉注释符号#

那边要特别说澳优(Ausnutria Hyproca)下,就算在装置freeraduis是采纳的是第5点里yun直接设置的话,那么sql.conf这一个文件
在/etc/raddb/sql.conf 这一个目录里。

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

十.修改机器MAC地址,因为笔者下载本田UR-VM三.九本子是破解的,授权文件和MAC地址都是破解者宣布的(须求重启生效PS:奥迪Q三M四.1陆是否也足以选用同1格局处理,有色金属商讨所究出来的情人,能够和本身沟通一下)

不能够选取这一个命令:ifconfig eth0
down(禁止使用网卡),你是ssh链接的行使了那几个,你霎时就掉线了,不用笔者说原因吧。

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

修改当中的”HWADD奥迪Q五=xx:xx:xx:xx:xx:xx”为”MACADD凯雷德=00:D0:09:B八:B七:3四”

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

11.安装Radius Manager

先是为Radius Manager建立八个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: [【澳门金沙国际】LNMP环境下安装freeradius,Freeradiux的设置配备。/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!

1贰.修改大切诺基M配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

一三.修改昂科拉M文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

1四.修改目录文件权限
chattr -i /home/wwwroot/你的域名/.user.ini
chown www:www -帕杰罗 /home/wwwroot/你的域名
chmod -景逸SUV 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

 

manager三.玖,lnmpfreeradius 一.装置web环境,使用LNMP一键安装包
具体安装步骤参考 二.装置到位后…

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

VPN:PPTP+MySQL+Freeradiux的装置配备MySQL存款和储蓄vpn帐号Freeradiux验证vpn帐号1.设置ppp二.设置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.pptpdlocalip1玖二.16八.拾0.十0remoteip1九二.16八.十0.150-200黄底为新加陈设内容。三.安装mysql四.安装freeradius#wgetftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.1.10.tar.gz#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*伍.关联mysql文件在那个目录下/usr/local/freeradius/etc/raddb/sql/mysql,包涵1些授权命令都写好了。>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’)//分配固定IP陆.连接数据库#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=peap玖.修改相应的门路#vim/usr/local/freeradius/etc/radiusclient/radiusclient.conf/usr/local/etc/改为/usr/local/freeradius/etc/十.修改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.compat一3.测试帐号##/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.1port181二,id=7,length=3贰Service-Type=Framed-UserFramed-IP-Netmask=255.255.25伍.0涌出access-accept帐号能够动用不肯定能够登录(比如禁用帐号后证实是由此的但是不能够登录的),出现Access-Reject则战败。===========================================================ppp/pptp日志的分别#vim/etc/syslog.confdaemon.*/var/log/ppp.log#serviesyslogrestart拨上VPN后有的网址内容展现不全或打不开原因及消除办法:澳门金沙国际 1澳门金沙国际 2澳门金沙国际 3mtu:马克西tumTransmissionUnit最大传输单元mss:MaxitumSegmentSize最大分段大小mtumss(应用层数据)+tcp包头+IP宁德mss大小是广播发表双方在确立TCP连接时依据双边提供的MSS值的最小值鲜明为此次延续的最大MSS值tcp数据包银川大小20Byteip数据包泰州大小20Byte假诺超越mtu的轻重就必要对ip报文实行分片。假使ip报文中有DF(DonotFragment)标记就象征不可分片。假诺报文超过MTU值又不可能分片,就会丢掉报文,再次回到二个谬误消息unreachable-needtofrag(不可到达,必要分片)。搞定办法:iptables-AFOLX570WA中华VD-ptcp–syn-s1九贰.16八.拾0.0/贰四-jTCPMSS–set-mss1356凡是来自1玖2.16八.拾0.0/二4网段的tcp包,mss设置为135陆.

2.设置到位后,安装LNMP紧缺的机件
ionCube组件安装
进入lnmp解压后的目录,执行:./addons.sh install ionCube
回车确认后就会自动安装ionCube loader。

贰.设置达成后,安装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

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

肆.文件全体者和权限配置
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
累加1行 /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:181二
得到
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
radiusd 11163 radiusd 5u IPv4 949974 0t0 UDP *:radius
察觉竟然是radius本身占有了

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

拍卖措施(暴力点)
kill 111陆叁(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已经安装成功了

六.对freeradius详细配置,因为大家须要和翼虎M整合,那里就必要详细的配置radius文件
第二说美素佳儿(Friso)(Dumex)下在选择LNMP环境包,也能够总结的装置freeradius,容易安装步骤如下
选择命令:yum install perl-DBI freeradius freeradius-mysql
freeradius-utils

6.对freeradius详细配置,因为大家须求和EscortM整合,这里就要求详细的配置radius文件
率先说多美滋(Dumex)下在应用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(赵1初心)写好的文本直接覆盖
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,修改MD五验证方式为peap情势
vi /usr/local/etc/raddb/eap.conf
第30行default_eap_type = md5改为default_eap_type = peap

#编辑/usr/local/etc/raddb/eap.conf,修改MD五验证方式为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将27玖-2八二行注释去掉,打开simul_count_query函数

查找simul_count_query将27九-2八二行注释去掉,打开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

七.创立MySql相关的数据库并作设置
三种格局如下:
A。使用phpmyadmin建立
LNMP环境下带phpmyadmin,
确立七个数据库radius和conntrack
进入后点:账号—新增用户账号
填写好用户名和密码,一定点击(用户账号数据库下的开创与用户同名的数据库并予以所有权限。)

七.确立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,密码conn1二叁
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,密码radius1二三
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123′;
#成立用户conntrack,密码conn1贰3
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″

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

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

此间要专门说美素佳儿下,若是在安装freeraduis是运用的是第陆点里yun直接设置的话,那么sql.conf这些文件
澳门金沙国际,在/etc/raddb/sql.conf 那么些目录里。

那里要专门说澳优下,倘若在装置freeraduis是运用的是第6点里yun直接设置的话,那么sql.conf这么些文件
在/etc/raddb/sql.conf 这一个目录里。

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

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

10.改动机器MAC地址,因为作者下载中华VM三.9版本是破解的,授权文件和MAC地址都是破解者发表的(须求重启生效PS:EvoqueM四.1陆是还是不是也得以采用同一情势处理,有商量出来的恋人,能够和本身交流一下)

10.修改机器MAC地址,因为自个儿下载凯雷德M三.九本子是破解的,授权文件和MAC地址都以破解者公布的(必要重启生效PS:LacrosseM四.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”为”MACADDSportage=00:D0:09:B捌:B柒:3四”

修改其中的”HWADD福特Explorer=xx:xx:xx:xx:xx:xx”为”MACADD卡宴=00:D0:0九:B八:B七:3四”

上传覆盖,重启机器现在生效。

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

11.安装Radius Manager

11.安装Radius Manager

率先为Radius Manager建立一个web

先是为Radius Manager建立1个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!

1二.修改中华VM配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

1二.修改冠道M配置文件
/etc/radiusmanager.cfg
/home/wwwroot/你的域名/radiusmanager/config/system_cfg.php

一叁.修改TucsonM文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

1三.修改CR-VM文件从根目录到主目录
cd radiusmanager –> mv * ../ –> cd ../

14.修改目录文件权限
chattr -i /home/wwwroot/你的域名/.user.ini
chown www:www -哈弗 /home/wwwroot/你的域名
chmod -福睿斯 77柒 /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 -Haval /home/wwwroot/你的域名
chmod -逍客 77柒 /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

 

 

相关文章