andrew pakpahan_ installing and configuring freeradius + mysql and daloradius + mysql on ubuntu...
DESCRIPTION
Andrew Pakpahan_ Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12TRANSCRIPT
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 1/10
My Thoughts, My Ideas, My Experiences, My Friends
Andrew Pakpahan
Sunday, August 19, 2012
Installing and Configuring Freeradius + MySQL andDaloradius + MySQL on Ubuntu Server 12.04 for MikrotikHotspot/PPoE/PPTP (updated)Installing and Configuring Freeradius
The first step is to Install Freeradius (ensure you already update your apt with aptupdate)$sudo aptget install freeradius
* Starting FreeRADIUS daemon freeradius [ OK ]
Setting up freeradiusutils (2.1.10+dfsg3build2) ...
Then prepare the database for freeradius. Create database radius and assign username andpassword for accessing it.
# mysql u root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.240ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database radius;
mysql> grant all on radius.* to radius@localhost identified by "thepassword";
Query OK, 0 rows affected (0.00 sec)
The next step was to insert the database schema and I realized that I could not find the databasescheme in /etc/freeradius.
Obviously I should install freeradiusmysql package first.
#aptget install freeradiusmysql
Setting up freeradiusmysql (2.1.10+dfsg3build2) ...
* Reloading FreeRADIUS daemon freeradius [ OK ]
Then insert the database scheme
# mysql u root p radius < /etc/freeradius/sql/mysql/schema.sql
Enter password:
# mysql u root p radius < /etc/freeradius/sql/mysql/nas.sql
Enter password:
Now we try to insert new user for testing purpose in database.
# mysql u root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 72
Server version: 5.5.240ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
apple (4)
Bandwidth Management (2)
Bandwidthd (1)
Fedora Core (8)
Gak Penting (1)
Google Chrome (2)
Info (4)
LAMP (1)
Linux (12)
Mail Server (3)
Mikrotik (1)
MyExperiences (12)
MySQL (1)
Network (9)
New technologies (8)
Security (1)
Server (9)
Ubuntu (2)
Virus (1)
Labels
2012 (5) September (1)
August (2)
How to enable MySQLremote access onUbuntu Server...
Installing and ConfiguringFreeradius + MySQLand ...
May (2)
2011 (2)
2010 (5)
2009 (3)
2008 (18)
2007 (19)
2006 (9)
Blog Archive
0 Lainnya Blog Berikut» [email protected] Dasbor Keluar
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 2/10
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
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 (UserName, Attribute, Value) VALUES ('sqltest', 'Password',
'testpwd');
Query OK, 1 row affected (0.04 sec)
mysql> exit
Bye
The next step is we need to configure the Freeradius files.
Edit /etc/freeradius/sql.conf file. Setting database type, login and password that we already setupbefore.
# vim /etc/freeradius/sql.conf
database = mysql
login = radius
password = thepassword
readclients = yes
Then edit the /etc/freeradius/sitesenabled/default file
# vim /etc/freeradius/sitesenabled/default
Uncomment sql on authorize # See “Authorization Queries” in sql.conf
sql
Uncomment sql on accounting
# See “Accounting queries” in sql.conf
sql
Uncomment sql on session
# See “Simultaneous Use Checking Queries” in sql.conf
sql
Uncomment sql on postauth
# See “Authentication Logging Queries” in sql.conf
sql
Then we edit /etc/freeradius/radiusd.conf file
# vim /etc/freeradius/radiusd.conf
#Uncomment #$INCLUDE sql.conf
$INCLUDE sql.conf
To test our configuration, first we must stop the freeradius service (if already running) # /etc/init.d/freeradius stop
* Stopping FreeRADIUS daemon freeradius [ OK ]
Then run this command to run freeradius in debugging mode. If there is no error, you are good to go.#freeradius X
On a new shell or window we tested the connection
$ radtest sqltest testpwd localhost 18128 testing123
Sending AccessRequest of id 65 to 127.0.0.1 port 1812
2005 (14)
Live Traffic Feed
Realtime view · Get Feedjit
A visitor from Semarang,Jawa Tengah viewed"Andrew Pakpahan:Installing and ConfiguringFreeradius + MySQL andDaloradius + MySQL onUbuntu Server 12.04 forMikrotikHotspot/PPoE/PPTP(updated)" 28 secs ago
A visitor from Indonesiaviewed "AndrewPakpahan: Membatasivoucher hotspot mikrotikberdasarkan waktu aktif"19 mins agoA visitor from Indonesiaviewed "AndrewPakpahan: Membatasivoucher hotspot mikrotikberdasarkan waktu aktif"46 mins agoA visitor from Indonesiaviewed "AndrewPakpahan: Menggantitimezone Ubuntu ServerMenjadi Waktu Indonesia(Asia/Jakarta)" 47 minsagoA visitor from Polska,KujawskoPomorskieviewed "AndrewPakpahan: Network" 3 hrs2 mins agoA visitor from Jakarta,Jakarta Raya viewed"Andrew Pakpahan: Howto enable MySQL remoteaccess on Ubuntu Server12.04" 4 hrs 10 mins agoA visitor from Neuquenviewed "AndrewPakpahan: How ToMonitor Network withNtop on Ubuntu 10.04and Mikrotik" 4 hrs 54mins ago
A visitor from Engen,BadenWurttembergviewed "AndrewPakpahan: Installing andConfiguring Freeradius +MySQL and Daloradius +MySQL on UbuntuServer 12.04 for MikrotikHotspot/PPoE/PPTP(updated)" 4 hrs 56 minsago
A visitor from Mesa,Arizona viewed "AndrewPakpahan: How to enableSNMP Monitoring onUbuntu Server 12.04.2" 5hrs 16 mins agoA visitor from Brescia,Lombardia viewed"Andrew Pakpahan:Installing and ConfiguringFreeradius + MySQL andDaloradius + MySQL onUbuntu Server 12.04 for
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 3/10
UserName = "sqltest"
UserPassword = "testpwd"
NASIPAddress = 127.0.1.1
NASPort = 18128
rad_recv: AccessAccept packet from host 127.0.0.1 port 1812, id=65, length=20
The test running well with Accept response from the server.
To enable Mikrotik device to access our server we need to add client in clients.conf file.
#vim /etc/freeradius/clients.conf
client 10.0.0.0/8
secret = testingpassword
shortname = testing
nastype= mikrotik
*note: we need to stop freeradius X and then running it again to test our configuration
Update (Jan 27, 2013): If we want to add specific value for Mikrotik, we need to add mikrotikdictionary
#vim /etc/freeradius/dictionary
Then add this line below
$INCLUDE /usr/share/freeradius/dictionary.mikrotik
Mikrotik Configuration
We need to configure our Mikrotik devices to use our new radius server. We need to login to Mikrotikdevice and configure the radius in Radius menu.
Below image is an example of our configuration.
*Note: we increase timeout settting to 3000ms to enable invalid login notifications. (not working withdefault 300ms)
Daloradius Installation
First, we need to download daloradius file
$wget http://downloads.sourceforge.net/project/daloradius/daloradius/daloradius0.99/daloradius
0.99.tar.gz?
r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdaloradius%2Ffiles%2F&ts=1345296201&use_mirror=nchc
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 4/10
Posted by Andrew Pakpahan at 3:23 PM
Rename and extract the file
# tar xvfz daloradius0.99.tar.gz
# mv daloradius0.99 daloradius
Move the file to the web server directory. In this case I use apache on Ubuntu so the location is at/var/www
# mv daloradius0.99 daloradius
# mv daloradius /var/www
Then we need to setup the database. Because already setup the freeradius using MySQL, so wedon't need new database. All we need to do is to import the daloradius scheme into our existingradius database.
# cd /var/www/daloradius/contrib/db
# mysql u root p radius < mysqldaloradius.sql
After database successfully altered, we need to configure the daloradius setting.
#vim /var/www/daloradius/library/daloradius.conf.php
Change the database password
$configValues['CONFIG_DB_PASS'] = 'thepassword';
Then we can try to access daloradius using http://ipaddressoftheserver/daloradius
*Note: In my installation, i had a problem because I didn't have php5gd phppear and phpdbpackages installed on my Ubuntu server.
To deal with this problem you can install the packages using
# aptget install php5gd phppear phpdb
References,
Mastaqim (2012), http://www.mastaqim.web.id/2012/08/installfreeradiusmysqlubuntuserver.htmlDaud (2012), http://daud.rasadigital.com/installdaloradiusdiubuntuserver/
35 comments:Anonymous said...
am totally new to ubuntu.suppose i run something like this"vi debian/rules" and i finish with editing the script, howdo i save it and go back to the main terminal.i am stranded here. i end up closing the terminal thinking it would ask me to savechanges but nothing. The changes are not effected when i go back to check on the scriptagain.
Wednesday, August 22, 2012
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 5/10
Andrew Pakpahan said...
To exit from vi you can press [esc] then press [:wq!] then enter.
Wednesday, August 22, 2012
Golgot said...
Great job, Thanks ,
at the end to log into daloradius page :
http://your ip address/daloradius
Login to the management:username: administratorpassword: radius
Wednesday, September 19, 2012
Rizha Ardianto said...
Thanks for your nice post Andrew.
Im trying to use coovachilli but still not working. Any ideas how to use it with daloradiusin this post?
Thank you
Monday, September 24, 2012
Rizha Ardianto said...
Thanks for your nice post Andrew.
Im trying to get coovachilli work, but still no luck. Any ideas how to make it work withthis setup?
Big thanks
Monday, September 24, 2012
Andrew Pakpahan said...
@Golgot: Thanks :)
@ Rizha: I haven't tried coova chilli , but I think your problem is in the coova chilliconfiguration with freeradius.
Tuesday, September 25, 2012
hidrargium said...
Hi, Andrew.
Thank you for a good article.
Some notes:
After adding new granst in MySQL:grant all on radius.* to radius@localhost identified by "thepassword";You need to preform next command: flush privileges;
Tuesday, October 09, 2012
Rizha said...
Andrew,
how if we want to use an external radius server?
Thursday, October 11, 2012
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 6/10
GoldenNetworks said...
#vim /etc/freeradius/clients.conf
client 10.0.0.0/8
secret = testingpasswordshortname = testingnastype= mikrotik
when i enter down in the last already 3 4 entries /24 /32 etcwhere i have to add this entry or edit the existing one ???Please quick reply im stuck on the edge.
Monday, October 22, 2012
Andrew Pakpahan said...
@GoldenNetwork:
Just add as new lines. Put comments on all previous lines.
Monday, October 22, 2012
GoldenNetworks said...
Well i have done everything through ur blog n i got the result in positive when i givecommand for radtest. it seems to b ok
but as im using ubuntu server 12.04 Lts so im unable to access daloradius page.127.0.0.1/daloradius.
i dont know how to attach it with the mikrotik by cable
Tuesday, October 23, 2012
Andrew Pakpahan said...
@GoldenNetwork
Do you understand IP address concept? You need to understand this before even tryingthis setup.
Thursday, October 25, 2012
GoldenNetworks said...
Thanx for reply... i did same as u mentioned the same ips 10.0.0.0/8 even in mikrotik10.0.0.50hotspot setup already working in routerboard.should i use 1 simple ethernet cable between daloradius n mikrotik ???what ip would be assigned to the mikrotik interface ???should i use this topology: http://bejatijampang.files.wordpress.com/2012/07/slide2300x296.jpgshould i have to add 2 lan cards in ubuntu box or after the setup remove the internet fromubuntu and put 1 jumper between mikrotik n ubuntu as i linked up topology ???
The daloradius box is ready my problem is how to make connections betweenrouterboard and daloradius box to get access daloradious webpage
Friday, October 26, 2012
Vanderwyk Siahaan said...
why i found message
"no response from server for ID 210 socket 3"
how to resolft it?
Monday, December 03, 2012
Divya S said...
thank u sir..it helped us a lot :)
Tuesday, January 29, 2013
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 7/10
Rosso said...
Hello Andrew, thnk for this blog. I have a small question, can i put the server on a different location. Will this make all traffic go to the external server?
Friday, March 29, 2013
Hamad Ahmed said...
Hi All,
First thanks to Andrew.
I am trying to install daloRADIUS , but I am facing some issues with sql moduleconfigurations. When I uncomment the sql from the configuration file I received thefollowing error.
/etc/freeradius/sql.conf[22]: Instantiation failed for module "sql"/etc/freeradius/sitesenabled/default[159]: Failed to load module "sql"./etc/freeradius/sitesenabled/default[62]: Errors parsing authorize section.
anyone can help ?
Thanks,Hamad
Wednesday, April 24, 2013
Pavlos said...
Great article. I followed it and it seams it works.
I have a question. Now after configuring the server and the mikrotik. First how can I check if they communicate?Second how can I test if a user authenticates when it connects to wifi ?
Thank you
Monday, May 20, 2013
Andrew Pakpahan said...
@Pavlos: You can try to activate hotspot on your wireless interface. Then try to loginwith you radius account.
Tuesday, May 21, 2013
Alejandro said...
Congratulations for your cool post and thanks for sharing your experience.
I've two questions:
Is the number of users limited? Which is the home page for the hotspot login users and can I configure a new one?
Thanks in advance.Greetings.
Wednesday, September 04, 2013
Kevin said...
Thanks Andrew. After follow your blog, I got to http://localhost/daloradius after typing in:user name: administratorpassword: radius I receive an error message. "Database connection error DB error extension not found.
Please help.Thanks.
Saturday, January 11, 2014
Anonymous said...
Thanks you for your help, Great job worked for me without much trouble.
Wednesday, February 12, 2014
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 8/10
Anonymous said...
I have been working my way through this config as new to Ubuntu
All seemed to be going well until i tested using radtest which returns the following error:Invalid octet string "sqltest" for attribute name "UserName"radclient: Nothing to send.
I have viewed the table contents and it all looks in order and double checked theconfig??
Any help would be very much appreciated. Thanks
Wednesday, March 26, 2014
alfurqan said...
hi,
would you help me, what means that: unable to open file"/etc/freeradius/sql/mysql/ippooldhcp.conf": no such file or directoryerrors reading or parsing /etc/freeradius/radiusd.conf
Saturday, June 14, 2014
Anonymous said...
Hi,
I have followed this link for reference in running daloradius with freereadius.
https://help.ubuntu.com/community/CategoryNetworking/daloRADIUS
but I can't seem to get pass the login page.
http://192.168.2.133/daloradius/dologin.php
Database connection errorError Message: DB Error: connect failed
could you point out what I have missed?I have used both 12.04 and 14.04 LTS and both have same error message
what output do you need in order to further troubleshoot this?
many thanks,
Tuesday, July 08, 2014
Anonymous said...
I have Freeradius running on Ubuntu 12.04 server, to authenticate iBurst clients of myISP. It is working fine, the only issue is that I don't know how to manage these clients.
For example if a client has not payed to use Internet, I need to be able to disconnecthim/her and reconnect him/her once the payment has been done. The only way that Iknow is to edit the /etc/freeradius/users file and comment the FramedIPAddress linewhich is not easy to do every time. Also, I fear that I might accidentally damage the fileif I continue accessing it everyday and modifying it.
I would like to know if there is any other way to do this (preferably through a web client). Ifound one called Dialupadmin web interface, but I don't know if I have to installFreeradius from scratch to be able to use the web interface or if I can just install this anduse the existing Freeradius without reinstallation.
Thursday, July 17, 2014
odik's said...
Andrew, pls help! i am am trying to install daloRADIUS , but I am facing some issueswith sql module configurations. When I uncomment the sql from the configuration file Ireceived the following error.
/etc/freeradius/sql.conf[22]: Instantiation failed for module "sql"/etc/freeradius/sitesenabled/default[159]: Failed to load module "sql"./etc/freeradius/sitesenabled/default[62]: Errors parsing authorize section.
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 9/10
Monday, July 28, 2014
Herman said...
Thank you for the great guide!Works like a charm.
Herman
Monday, October 20, 2014
Anonymous said...
I also get this error:
Database connection errorError Message: DB Error: extension not found
Please help. Thanks.
Tuesday, January 13, 2015
Anonymous said...
The solution for Database connection errorError Message: DB Error: extension not found
is aptget install phpmysql
Wednesday, January 14, 2015
saman supriadi said...
i got errors like this, where is false mister, im running freeradius in freebsd 10.01 root@saman:/usr/home/saman # radtest sqltest testpwd 127.0.0.1 1812 testing123Sending AccessRequest of id 154 to 127.0.0.1 port 1812UserName = "sqltest"UserPassword = "testpwd"NASIPAddress = 10.20.30.124NASPort = 1812MessageAuthenticator = 0x00000000000000000000000000000000Sending AccessRequest of id 154 to 127.0.0.1 port 1812UserName = "sqltest"UserPassword = "testpwd"NASIPAddress = 10.20.30.124NASPort = 1812MessageAuthenticator = 0x00000000000000000000000000000000Sending AccessRequest of id 154 to 127.0.0.1 port 1812UserName = "sqltest"UserPassword = "testpwd"NASIPAddress = 10.20.30.124NASPort = 1812MessageAuthenticator = 0x00000000000000000000000000000000radclient: no response from server for ID 154 socket 3
Saturday, May 16, 2015
Anonymous said...
Andrew, I found your post interesting and very informative. Thanks for taking the time towrite the article. Just a small note, did you mean to move the daloradius to the root forwww? Is so then the next line is incorrect. It should be /var/www/contrib and not/var/www/daloradius/contrib.
Thanks again for your time!
Sunday, May 17, 2015
Joseph Dodosh said...
Monday, June 15, 2015
Counter Strike Condition Zero Full Version said...
Thank you for the great guide!
This comment has been removed by the author.
12/19/2015 Andrew Pakpahan: Installing and Configuring Freeradius + MySQL and Daloradius + MySQL on Ubuntu Server 12.04 for Mikrotik Hotspot/PPoE/PPTP …
http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html 10/10
Newer Post Older PostHome
Subscribe to: Post Comments (Atom)
Post a Comment
Works like a charm.
Tuesday, September 01, 2015
Roshan More said...
Sir,When i execute a command for radtest it gives me an output accessreject from host.pls help me out sir..
Wednesday, December 02, 2015