freeRADIUS dan MySQL Server Pada Ubuntu 9.10

February 15th, 2010
by Hendra

Remote Authentication Dial In User Service (RADIUS) is a networking protocol that provides centralized Authentication, Authorization, and Accounting (AAA) management for computers to connect and use a network service. RADIUS was developed by Livingston Enterprises, Inc., in 1991 as an access server authentication and accounting protocol and later brought into the IETF standards. (Wikipedia)Uraian di atas adalah penjelasan singkat mengenai apa itu radius server. Ada banyak sekali aplikasi yang berfungsi sebagai Radius Server, antara lain: freeRADIUS, Network RADIUS, EliteAAA, RADIUS-VMS, GNU RADIUS, OpenRADIUS, BSDRadius, Alepo Radius Server, dan sebagainya. Di kalangan komunitas, freeRADIUS adalah yang paling banyak digunakan.

Pada distro Ubuntu, khususnya versi 9.10, paket freeradius sudah ada pada repository. Juga module atau dukungan untuk bekerja dengan MySQL, yang bernama freeradius-mysql. Juga paket mysql-server harus diinstall karena akan digunakan sebagai database bagi radius server. Sehingga untuk instalasinya cukup menggunakan perintah berikut:


sudo apt-get install mysql-server

sudo apt-get install freeradius freeradius-mysql


Kemudian dilanjutkan dengan konfigurasi freeRADIUS.


sudo nano /etc/freeradius/radiusd.conf


Pada baris:

proxy_requests  = yes

$INCLUDE proxy.conf


diganti menjadi:

proxy_requests  = no

$INCLUDE proxy.conf


Selanjutnya pengaturan sql pada freeRADIUS:

sudo nano /etc/freeradius/sql.conf


Pada baris berikut:

# Connection info:
server = “localhost”
login = “radius”
password = “radpass”

Diganti sesuai server yang digunakan:


# Connection info:
server = “localhost”
login = “root”
password = “passwordrootmysql”

Dan uncomment baris berikut:


#readclients = yes

Sehingga menjadi:


readclients = yes

Selanjutnya pengaturan pada vhost freeRADIUS (fitur freeRADIUS mulai versi 2.0):


sudo nano /etc/freeradius/sites-enabled/default

Uncomment sql pada section-section berikut:


authorize{
accounting{
session{
post-auth{

Dan pengaturan terakhir freeRADIUS yaitu pada pengaturan client. Client di sini adalah client yang akan mengakses protocol AAA pada Radius Server.


sudo nano /etc/freeradius/clients.conf

Pada setup ini saya hanya menggunakan localhost untuk pengujian, sehingga hanya section berikut yang diubah:


client localhost {
ipaddr = 127.0.0.1
secret  = testing123
require_message_authenticator = no
nastype   = other
}

Bagian secret dapat diubah sesuai keinginan, dengan catatan secret inilah yang nantinya digunakan saat otentikasi.
Setelah selesai, restart freeradius server.


sudo /etc/init.d/freeradius restart

Kemudian pengaturan database, yang perlu dilakukan adalah pembuatan database “radius”, import skema database radius untuk mysql dan penambahan user dan password untuk pengujian. Berikut langkah-langkahnya:


mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.1.37-1ubuntu5 (Ubuntu)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> create database radius;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye

Selanjutnya import schema database:


mysql -u root -p radius < /etc/freeradius/sql/mysql/schema.sql
Enter password:

Untuk memeriksa apakah skema database sudah diimport dengan baik, dapat dilakukan dengan cara berikut:


mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.1.37-1ubuntu5 (Ubuntu)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show databases;
+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| radius             |
+——————–+
3 rows in set (0.00 sec)
mysql> use radius;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+——————+
| Tables_in_radius |
+——————+
| radacct          |
| radcheck         |
| radgroupcheck    |
| radgroupreply    |
| radpostauth      |
| radreply         |
| radusergroup     |
+——————+
7 rows in set (0.00 sec)
mysql> quit
Bye

Selanjutnya memasukkan username dan password untuk pengujian, yaitu dengan input ke table radcheck:


mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.1.37-1ubuntu5 (Ubuntu)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> use radius
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> insert into radcheck
-> (id, username, attribute, op, value)
-> values
-> (“1″, “hendra”, “User-Password”, “:=”, “coba”);
Query OK, 1 row affected (0.00 sec)
mysql> select * from radcheck;
+—-+———-+—————+—-+——-+
| id | username | attribute     | op | value |
+—-+———-+—————+—-+——-+
|  1 | hendra   | User-Password | := | coba  |
+—-+———-+—————+—-+——-+
1 row in set (0.00 sec)
mysql> quit
Bye

Yang terakhir adalah pengujian freeRADIUS server:


radtest hendra coba 127.0.0.1 1812 testing123

Tags: , , , ,
Posted in Linux | Comments (3)

3 Responses to “freeRADIUS dan MySQL Server Pada Ubuntu 9.10”

  1. phitoosh Says:

    : Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
    aku dapet ubuntu 9.10 langsung dari pemiliknya dari netherlands… aku ikutin nstalasi diatas tapi nemunya seperti tulisan diatas ini

    @phitoosh, apakah ada software lain yang sedang menggunakan dpkg? misalnya Synaptic, Update Manager, atau Ubuntu Software Center?

  2. surya Says:

    bisa dijelasin lebih detil om , soal nya saya kurang ngerti baris perbaris, kemudian fungsi masing2 scrip ^_^
    sekalian kasih contoh tes ting nya :D makasih
    di tunggu jawaban nya

  3. Edi Sujono Says:

    Saya coba keluar pessan error seperti ini :
    “radclient: no response from server for ID 207 socket 3″

    Mohon bantuannya.
    Thanks

Leave a Reply