海运的博客

Centos安装Freeradius+daloRADIUS配合ROS PPPOE验证

发布时间:July 27, 2012 // 分类:RADIUS,ROS // 3 Comments

之前有介绍安装Radiusmanager做为ROS验证服务器,不过Radiusmanager为商业软件,喜欢开源软件的可使用daloRADIUS替代,功能同样强大。
LAMP环境安装:

yum -y install httpd httpd-devel mysql mysql-server mysql-devel
yum -y install php php-devel php-mysql php-common php-gd php-mbstring php-mcrypt php-xml
/etc/init.d/httpd start
/etc/init.d/mysqld start
chkconfig httpd on
chkconfig mysqld on
mysqladmin -u root password 'newpassowrd'

Freeradius安装:

yum install freeradius2 freeradius2-mysql freeradius2-utils
/etc/init.d/radiusd start
chkconfig radiusd on

测试Freeradius:

radiusd -X
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /var/run/radiusd/radiusd.sock
Listening on authentication address 127.0.0.1 port 18120 as server inner-tunnel
Listening on proxy address * port 1814
Ready to process requests.

配置Freeradius支持sql:

cat /etc/raddb/radiusd.conf 
$INCLUDE sql.conf #调用sql.conf配置,去除之前的#
cat /etc/raddb/sites-enabled/default #下两段中添加sql
authorize {
    preprocess
    chap
    mschap
    digest
    suffix
    eap {
        ok = return
    }
    files
    sql
    expiration
    logintime
    pap
}
accounting {
    detail
    unix
    radutmp
    sql
    exec
    attr_filter.accounting_response
}

设置Freeradius sql连接信息:

cat /etc/raddb/sql.conf 
    database = "mysql"
    driver = "rlm_sql_${database}"
    server = "localhost"
    #port = 3306
    login = "radius"
    password = "radiupass"
      radius_db = "radius"

安装DaloRADIUS

wget http://downloads.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz
tar zxvf daloradius-0.9-9.tar.gz 
mv daloradius-0.9-9 /var/www/html/daloradius
chown -R apache:apache /var/www/html/daloradius

创建数据库并导入:

mysql -u root -p
mysql>create database radius;
mysql>grant all on radius.* to radius@localhost identified by "radpass"; 
mysql>exit;
mysql -uroot -p radius < /var/www/html/daloradius/contrib/db/mysql-daloradius.sql 
mysql -uroot -p radius < /var/www/html/daloradius/contrib/db/fr2-mysql-daloradius-and-freeradius.sql 

配置DaloRADIUS:

cat cat /var/www/html/daloradius/library/daloradius.conf.php
$configValues['CONFIG_DB_ENGINE'] = 'mysql';
$configValues['CONFIG_DB_HOST'] = 'localhost';
$configValues['CONFIG_DB_PORT'] = '3306';
$configValues['CONFIG_DB_USER'] = 'radius';
$configValues['CONFIG_DB_PASS'] = 'radpass';
$configValues['CONFIG_DB_NAME'] = 'radius';
$configValues['CONFIG_PATH_DALO_VARIABLE_DATA'] = '/var/www/daloradius/var'; #如在别目录需修改

添加RADIUS客户端:

cat /etc/raddb/clients.conf
client 192.168.1.21 {
    secret        = root
    shortname    = ROS
}

通过浏览器访问www.haiyun.me/daloradius即可登录管理,默认账号:administrator,密码:radius。
Daloradius新建用户测试,ROS端配置RADIUS请参考:安装Radiusmanager做为ROS验证服务器
daloradius添加用户.png
通过Daloradius管理界面可查看在线用户:
daloradius在线用户.png

分类
最新文章
最近回复
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
  • zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...