记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

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



LAMP环境安装:

1
2
3
4
5
6
7
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安装:
1
2
3
yum install freeradius2 freeradius2-mysql freeradius2-utils
/etc/init.d/radiusd start
chkconfig radiusd on

测试Freeradius:
1
2
3
4
5
6
7
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:
1
2
cat /etc/raddb/radiusd.conf 
$INCLUDE sql.conf #调用sql.conf配置,去除之前的#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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连接信息:
1
2
3
4
5
6
7
8
cat /etc/raddb/sql.conf 
	database = "mysql"
	driver = "rlm_sql_${database}"
	server = "localhost"
	#port = 3306
	login = "radius"
	password = "radiupass"
  	radius_db = "radius"

安装DaloRADIUS:
1
2
3
4
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

创建数据库并导入:
1
2
3
4
5
6
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:
1
2
3
4
5
6
7
8
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客户端:
1
2
3
4
5
cat /etc/raddb/clients.conf
client 192.168.1.21 {
	secret		= root
	shortname	= ROS
}

通过浏览器访问http://IP/daloradius即可登录管理,默认账号:administrator,密码:radius。
Daloradius新建用户测试,ROS端配置RADIUS请参考:http://www.micoder.cc/blog/519.html
daloradius添加用户.png
通过Daloradius管理界面可查看在线用户:
daloradius在线用户.png


转载请标明出处【Centos安装Freeradius+daloRADIUS配合ROS PPPOE验证】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论