Sei sulla pagina 1di 15

FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Just Networking :)
Small steps in a wonderful world

Home
About

Home > IT Network > FreeRadius + Daloradius + Ubuntu Server – Configuration

FreeRadius + Daloradius + Ubuntu Server


– Configuration
November 1, 2014 Daniel Leave a comment Go to comments

Introduction

FreeRADIUS is the most popular open source RADIUS server and the most widely
deployed RADIUS server in the world. It supports all common authentication protocols,
and the server comes with a PHP-based web user administration tool called dialupadmin. It
supplies the AAA needs of many Fortune-500 companies.

daloRADIUS is an advanced RADIUS web management application aimed at managing


hotspots and general-purpose ISP deployments. It features user management, graphical
reporting, accounting, a billing engine and integrates with GoogleMaps for geo-locating.

Knowledge needed:

– Basic Linux commands

– Networking understanding

Software used:

OS: Ubuntu Server 14.04.1 LTS

VMware Player (LAN Bridge Connection)

Daloradius 0.9.9

LAMP

Hardware used:

1 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

AP TPLink, Model TL- MR3420

1. Installing LAMP

– Ubuntu Server, after installation: sudo apt-get update & sudo apt-get upgrade need to
be apply.

– Apache2: sudo apt-get install apache2

– PHP5: sudo apt-get install php5 & restart apache2: sudo service apache2 restart

– MySql server: sudo apt-get install mysql-server

When it asks for root password, give any password of your choice and note it.
Now we need to install another packet, so that Php5 and Mysql can understand each other.
sudo apt-get install php5-mysql

sudo service apache2 restart

Obs! A small error will appear to fix that, insert

ServerName localhost

in either httpd.conf or apache2.conf in /etc/apache2 and restart apache the notice will
disappear.

If you have a name inside /etc/hostname you can also use that name instead of
localhost.

2. Install & Configure FreeRadius

sudo apt-get install freeradius freeradius-mysql freeradius-utils

Next will open /etc/freeradius/eap.conf, to make some configurations:

sudo nano /etc/freeradius/eap.conf

default_eap_type = peap (need to be peap, DO NOT CHANGE in TTLS section)

now we will make some changes in /etc/freeradius/modules/mschap

sudo nano /etc/freeradius/modules/mschap

umcomment and change values, like how is shown bellow:

use_mppe = yes
require_encryption = yes
require_strong = yes
with_ntdomain_hack = yes

Save the files and issue this command line: sudo ldconfig

2 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

3. Create Mysql database for authentication

– NAS authentication

$: mysql -u root -p
mysql> create database radius;
mysql> create user ‘freeradius’@’localhost’ identified by ‘radius123’;
mysql> grant all on radius.* to ‘freeradius’@’localhost’ identified by ‘radius123’;
mysql> flush privileges;
mysql> exit;

Now we will import freeradius schema to our database. It is in /etc/freeradius/sql/mysql/

mysql -u freeradius -p radius < /etc/freeradius/sql/mysql/schema.sql


mysql -u freeradius -p radius < /etc/freeradius/sql/mysql/nas.sql

Enter the password for mysql user freeradius, which is radius123.


If it gives some problem with rights, then issue following commands before issuing above
commands.
sudo chmod 777 /etc/freeradius/sql/mysql/schema.sql
sudo chmod 777 /etc/freeradius/sql/mysql/nas.sql

Next step is to change freeradius for mysql, open /etc/freeradius/sites-available/default

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

uncomment the following line

in authorize section uncomment sql


in session section uncomment sql
in post-auth section uncomment sql
in accounting section uncomment sql

and comment files in authorize section #files

save and exit. Next, modify the login and the password:

sudo nano /etc/freeradius/sql.conf


login = "freeradius"
password = "radius123"

and uncomment readclients = yes

save and exit, next will uncomment the fallowing lines from:

sudo nano /etc/freeradius/radiusd.conf

$INCLUDE sql.conf
$INCLUDE sql/mysql/counter.conf

3 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

save and open:

sudo nano /etc/freeradius/sites-available/inner-tunnel

in authorize section uncomment sql

save, exit and restart freeradius.

sudo service freeradius restart

4. Install & Configure Daloradius

– Extra packages needed: sudo apt-get install php-db php-pear php5-gd

– Download Daloradius:
wget http://sourceforge.net/projects/daloradius/files/daloradius/daloradius0.9-9
/daloradius-0.9-9.tar.gz
tar zxvf daloradius-0.9-9.tar.gz

– import the daloradius schema to our radius database, password radius123.

mysql -u freeradius -p radius < daloradius-0.9-9/contrib/db/fr2-mysql-daloradius-


and-freeradius.sql

– enter the database username and password:

sudo nano daloradius-0.9-9/library/daloradius.conf.php

$configValues[‘CONFIG_DB_USER’] = ‘freeradius’;
$configValues[‘CONFIG_DB_PASS’] = ‘radius123’;

Now will move Daloradius:

sudo mv daloradius-0.9-9 /var/www/html/daloradius

Before to test it install phpmyadmin: sudo apt-get install phpmyadmin

Obs! Chose apache2 and when you are ask to configure the phpmyadmin database, chose
NO, database was already configured in the previous steps.

5. TESTING
http://myserver/daloradius

Username is administrator and password is radius.


Create users and NAS and dont forget to restart freeradius after that.

sudo service freeradius restart

4 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

To find out your radius server IP address, use in terminal ifconfig

6. Point AP to the RADIUS Server for authentication:

Problems encounter:

– Freeradius PID ERROR on restarting

Solution: sudo killall freeradius & sudo service freeradius start

– Debug Mode : sudo freeradius -X

– NAS device is not added in the freeradius/clients.conf

Solution added manually: sudo nano /etc/freeradius/clients.conf

client 192.168.0.1/24 {

secret = asus

shortname =tp

Save and restart freeradius.

5 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Share this:

Be the first to like this.

Categories: IT Network
Comments (48) Trackbacks (0) Leave a comment Trackback

1.
Nahid Rahman Mahmudur
January 17, 2015 at 5:50 am
Reply

What does this part presents? “client 192.168.0.1/24”


in the manual settings on clients.conf

Daniel
January 17, 2015 at 8:03 am
Reply

When you add “/24” will let know RADIUS server to allow connection from
all of the IP range 192.168.0.1 to 192.168.0.256, where 192.168.0.1 is the
NAS IP address or AP.

2.
Joey C
February 20, 2015 at 11:06 am
Reply

Hello,

Im getting error in this part

joey@joey-pc:/$ sudo mysql -u freeradius -p radius < /etc/freeradius/sql/mysql


/schema.sql
bash: /etc/freeradius/sql/mysql/schema.sql: Permission denied

Daniel
February 20, 2015 at 11:29 am
Reply

Try to use “radius123” as password.


In this setup there are some passwords that need to be defined and also
usernames.
To not mess thing up take note for each username & password that you create
and for what.

6 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

john
August 1, 2015 at 3:45 am
Reply

did you ever fix this? i hit the same error

Daniel
December 5, 2015 at 9:05 am

sudo chmod 777 /etc/freeradius/sql/mysql/schema.sql

3.
Dicky Prastianto Pramudya
June 15, 2015 at 12:17 am
Reply

Haii,
There is 3 section in “eap.conf”, eap section, peap section and ttls section, so in
which section should i change the “default_eap_type = peap”?

Dicky Prastianto Pramudya


June 15, 2015 at 1:37 am
Reply

I choose to change the setting only in “peap” section, after all it’s works.
Thank you.

4.
Joseph Dodosh
June 15, 2015 at 4:20 am
Reply

Hello,

everything for me works fine between Freeradius and sql since I created a user and
did the radtest to check if it works and that was successful but when I installed
daloradius and did all the settings for it I am getting the following error while I am
trying to login:

Database connection error


Error Message: DB Error: connect failed

Can you please help me to fix this error

Thanks

5.

7 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Bhagath
June 28, 2015 at 5:31 pm
Reply

Hello,

I am getting error in freeradius -X

pid dynamically change in every second with +2,

Ex: ps ax | grep radius


2395 pts/1 s+ 0:00 grep –colour=auto radius

ps ax | grep radius
2397 pts/1 s+ 0:00 grep –colour=auto radius

6.
dauzaylFirdaus
August 17, 2015 at 12:20 am
Reply

how to solved blank page on daloradius after login ?

7.
Bruno Brasil
August 28, 2015 at 4:45 pm
Reply

This is a thirt tutorial when a tried and NOT WORKS !

8.
Daniel
August 30, 2015 at 7:55 pm
Reply

Bruno try to install directly the virtual machine from: http://www.daloradius.com/


They are different options available on their website if you have difficulties
fallowing a tutorial.

9.
John
September 10, 2015 at 1:59 pm
Reply

the is no /etc/freeradius/sql/mysql/ in my setup…


maybe that’s the problem I can’t my setup to run because there isn’t any folders in
there

10.
Bao
September 17, 2015 at 3:16 am

8 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Reply

I get the following error when we try to display the Radius Log in Daloradius:

Error reading log file:

Looked for log file in /var/log/freeradius/radius.log and /usr/local/var/log/radius


/radius.log but couldn’t find it.
if you know where your freeradius log file is located, set it’s location in /daloradius
/rep-logs-radius.php

I looked in the rep-logs-radius.php file but are not seeing where


I set the log location.

11.
Roshan More
December 4, 2015 at 1:21 pm
Reply

is this freeradius+daloradius setup is compatible with TP-LINK routers??

Daniel
December 4, 2015 at 1:41 pm
Reply

Yes, I use a TP-Link router myself.

12.
Roshan More
December 4, 2015 at 1:36 pm
Reply

I had perform all steps properly but it is not working

13.
Roshan More
December 5, 2015 at 5:37 am
Reply

will u help me out in how to create NAS?? pls sir

14.
Roshan More
December 5, 2015 at 6:15 am
Reply

Actually I done with all the given steps but still i struggling to find expected result.

15.

9 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Roshan More
December 7, 2015 at 7:29 am
Reply

Authentication is done.but what about accounting??pls give me a solution

16.
Roshan More
December 8, 2015 at 10:09 am
Reply

pls give me some solution.accounting is not done after performing all the given steps

Marcus
December 8, 2015 at 12:13 pm
Reply

Daloradius is used only used for given access to users and devices. For more
accounting options a more complex setup is necessary and access to router
table.

17.
Roshan More
December 9, 2015 at 5:00 am
Reply

Ok.Thank u sir

18.
Roshan More
December 9, 2015 at 5:59 am
Reply

Sir ,
actually my radacct table is empty.how to update a radacct table??

19.
Roshan More
December 9, 2015 at 1:02 pm
Reply

pls guide me marcus sir for accounting.

20.
Roshan More
December 10, 2015 at 6:58 am
Reply

Actually I am really interested in learning this concepts,thats why asking

10 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

queries.will anybody help me out??

21.
Roshan More
December 10, 2015 at 8:53 am
Reply

is it possible to update radacct table manually???

22.
Steve
December 28, 2015 at 2:30 am
Reply

i have Server error 500 Help !!!

23.
Bojan Nikolić
January 17, 2016 at 11:13 am
Reply

I need help!

Where should I edit the RADIUS server IP 127.0.0.1 to the address that enable the
router to do … ?

Daniel
January 17, 2016 at 3:10 pm
Reply

to do what?

Bojan Nikolić
January 20, 2016 at 9:41 pm

How can I generate certificate CA for Windows OS, step by step?


Please you will be detailed.

24.
Roshan
January 18, 2016 at 11:08 am
Reply

Hello,
actually I done with all the given steps.my authentication is working but accounting
is not working.
my radacct table is empty.how to update a radacct table??

11 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Thanks in advance.

25.
Roshan More
January 18, 2016 at 11:15 am
Reply

Hello,
I done with all the given steps.my authentication is working properly but accounting
is not working.
My radacct table is showing empty.how to update radacct table??
pls guide me.
Thanks in advance.

26.
NAZ
March 8, 2016 at 1:43 pm
Reply

Hi Thanks for the procedure it help me a lot kindly guide if i want google auth for
two factor.

27.
edimi
March 11, 2016 at 8:23 am
Reply

It works for android devices but i can’t connect from windows. Is there anything i
should do to fix that?

28.
edimi
March 12, 2016 at 4:57 pm
Reply

Everything works great with android devices! It’s not working for windows 7. Is
there anything i can do about it?
Thank you.

29.
SZE
March 17, 2016 at 11:39 am
Reply

http://94.23.68.40/daloradius

I not found a specific step by step I’m getting everything I’ve correctly entered

30.
Sujith Sa Kuttan

12 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

March 25, 2016 at 9:52 am


Reply

Hi Daniel, When i am trying to create the user in freeradius through SQL, I get the
below mentioned error. Please help me to fix it.

mysql> create user ‘freeradius’@’localhost’ identified by ‘radius123’;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
‘‘radius123’’ at line 1

Raj Kishor Maharjan


May 5, 2016 at 2:49 am
Reply

did you by change get to solve the error as i am having the same error.

31.
Sujith Sa Kuttan
March 25, 2016 at 12:38 pm
Reply

Can Daloradius provide acces via captive portal for LAN users?

32.
dsoodak
April 7, 2016 at 6:11 pm
Reply

It seems to have installed fine but the file “eap.conf” does not exist

dsoodak
April 7, 2016 at 6:20 pm
Reply

however, there are a couple files named “eap” in /etc/freeradius/mods-


available and /etc/freeradius/mods-enabled

dsoodak
April 7, 2016 at 6:35 pm
Reply

looks like it has been renamed “eap and put in “mods-available” sub-directory
(comments still say “eap.conf”)

dsoodak

13 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

April 7, 2016 at 7:36 pm


Reply

for some reason changes made to the copy of a file in “mods-available” seem
to be echoed in the copy in “mods-enabled”.

33.
Dipak Mahajan
May 2, 2016 at 9:48 am
Reply

Hello Sir,
I have configure with freeradius+ubuntu+Daloradius. Now I log in daloradius but
what is the next steps? Which IP can I provide to NAS… and How to create plan/
hotspot / batch/ group/ attributes and users..so plz help me…

34.
Raj Maharjan
May 5, 2016 at 2:46 am
Reply

@sujith sa kuttan hello my friend did you by change get to solved the error
create user ‘freeradius’@’localhost’ identified by ‘radius123’;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
‘‘radius123’’ at line 1
since i am getting the same error
please help

dipak
May 5, 2016 at 10:00 am
Reply

try to run this command,


grant all on radius.* to ‘freeradius’@’localhost’ identified by ‘radius123’;

If it is not solved, then create new user and do all step one by one…

1. No trackbacks yet.

Leave a Reply

Using Python with Balance Board – Ubuntu


RSS feed

14 dari 15 23/06/2016 4:27


FreeRadius + Daloradius + Ubuntu Server – Configuration | Just Netw... https://dani33l.wordpress.com/2014/11/01/freeradius-daloradius-ubunt...

Recent Posts

FreeRadius + Daloradius + Ubuntu Server


– Configuration
Using Python with Balance Board
– Ubuntu
Windows 7 – Using Python with
Balance Board
How to install Balance Board on Linux
BeagleBoard – Installing Ubuntu
and Android

Archives

November 2014
November 2012
October 2012
September 2012
August 2012

Categories

IT Network

Meta

Register
Log in
Entries RSS
Comments RSS
Blog at WordPress.com.

Top
Blog at WordPress.com. The INove Theme.

15 dari 15 23/06/2016 4:27

Potrebbero piacerti anche