Thursday, May 14, 2009

Installation FreeRadius on Linux part 2

After you have finished installing and testing in the previous section, it's time to do the integration FreeRadius with MySQL database. Do not forget, MySQL database is installed correctly and running well. Ensure service http, mysql is running properly. For Centos/Redhat/RHEL/Fedora Distro, run /etc/init.d/httpd status and /etc/init.d/mysqld status.


Step by step configuration:

1. Create a new database, eg: radius
#mysqladmin-u root-p create a radius, to check, try login to database, #mysql-u root-p radius.


2. Import schema database from file db_mysql.sql, if nothing ,can be downloaded in here.
#mysql -u root -p radius <>.

#mysql -u root -p radius
mysql > show tables;


3. Edit file /usr/local/etc/raddb/sql.conf, edit line server, login, password and radius_db. In order to connect to the server and the MySQL database radius.
For example:
server = "localhost"
login = "root"
password = "yourpassword"
radius_db = "radius"

4. Edit file /usr/local/etc/raddb/radiusd.conf.
Add in word "sql" at part of Authorize and accounting, see the section on the following:
authorize {
preprocess
chap
mschap
#counter
#attr_filter
#eap
suffix
sql

files
#etc_smbpasswd
}

accounting {
acct_unique
detail
#counter
unix
sql
radutmp
#sradutmp
In authorize, place sql before files(if we do not want to use files, we can give comment (# sign) in front of files), and in accounting, place sql between unix and radutmp.
5. Create a dummy user in the table usergroups, radcheck, radreply, radgroupreply and radgroupcheck. You can use the mysql or phpmyadmin (can be downloaded in here).
mysql > select * from usergroup;

mysql > select * from radcheck;

mysql > select * from radreply;
mysql > select * from radgroupreply;

mysql > select * from radgroupcheck;


6. Run again with a radius debug mode, #/usr/local/sbin/radiusd -X.
7. Perform testing with radtest, eg such as data is entered above #radtest beni beni localhost 1812 testing123
The result is as follows:

Debugnya process can be viewed on the display mode debugnya:

8. Congratulations!!! You have finished integration between FreeRadius and MySQL database successfully.

No comments:

Post a Comment