FreeRadius记录登陆的错误信息到数据库
2016-07-22 14:34
465 查看
在modules里面添加attr_rewrite,内容为
然后修改default,在sql前面增加sanereplymessage
最后按照FreeRADIUS 2.x 记录认证者信息 修改usr/local/etc/raddb/sql/mysql/dialup.conf
postauth_query = "INSERT INTO ${postauth_table} \
(username, pass, reply, authdate,calledstationid, nasipaddress, replymessage) \
VALUES ( \
'%{User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply:Packet-Type}', '%S', '%{Calling-Station-Id}', '%{NAS-IP-Address}', '%{Module-Failure-Message}-%{reply:Reply-Message}')"
1 2 3 4 5 6 7 8 9 10 | attr_rewritesanereplymessage{ attribute=Reply-Message searchin=reply searchfor="\n|\r" replacewith="" ignore_case=no new_attribute=no max_matches=10 append=no } |
1 2 3 4 5 6 | Post-Auth-TypeREJECT{ .. sanereplymessage sql .. } |
postauth_query = "INSERT INTO ${postauth_table} \
(username, pass, reply, authdate,calledstationid, nasipaddress, replymessage) \
VALUES ( \
'%{User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply:Packet-Type}', '%S', '%{Calling-Station-Id}', '%{NAS-IP-Address}', '%{Module-Failure-Message}-%{reply:Reply-Message}')"
相关文章推荐
- MySQL中的integer 数据类型
- MySQL存储过程
- Android之获取手机上的图片和视频缩略图thumbnails
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- 数据库链接字符串查询网站
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法