Over 10 years we help companies reach their financial and branding goals. Engitech is a values-driven technology agency dedicated.

Gallery

Contacts

411 University St, Seattle, USA

+1 -800-456-478-23

Linux Server Ubuntu Server
free-radius-logo.png

FREERADIUS, MYSQL & DALORADIUS SERVER ON UBUNTU 18 & ABOVE

FreeRADIUS is an open source application that allows network to authenticate users who want to access network resources, such as the internet. It was built in the dial-up era to manage users and keep track of the bandwidth usage by each connection for billing purposes. RADIUS, which stands for “Remote Authentication Dial-In User Service“, is a network protocol used for remote user authentication and accounting. It provides AAA services; namely Authorization, Authentication, and Accounting. It is fast to set up and many networking programs like OpenVPN, SotfEther, Squid proxy and wifi managing tools can be integrated with FreeRADIUS.

[email protected][~]# sudo apt -y install freeradius freeradius-mysql freeradius-utils
[email protected][~]# sudo nano /etc/freeradius/3.0/radiusd.conf

On line 313 change auth_badpass = no to auth_badpass = yes

On line 314 change auth_goodpass = no to auth_goodpass = yes

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

DATABASE CREATION AND CONFIGURATION FOR FREERADIUS

INSTALLATION OF MYSQL SERVER

[email protected][~]# sudo apt-get -y install mysql-server mysql-client
[email protected][~]# mysql_secure_installation

Enter password for user root: <– Enter the MySQL root password

Change the password for root? (Press y|Y for Yes, any other key for No): <– n

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : <– y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : <– y   Reload privilege tables now? (Press y|Y for Yes, any other key for No) : <– y

[email protected][~]# sudo mysql -u root -p
[email protected][~]# CREATE DATABASE radius;
[email protected][~]# mysql -u root -p radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql
[email protected][~]# sudo nano /etc/freeradius/3.0/mods-enabled/sql

Your sql section should look similar to below.

sql {
driver = "rlm_sql_${dialect}"
dialect = "mysql"

# Connection info:
server = "localhost"
port = 3306
login = "radius"
password = "[email protected]"

# Database table configuration for everything except Oracle
radius_db = "radius"
}

# Set to ‘yes’ to read radius clients from the database (‘nas’ table)
# Clients will ONLY be read on server startup.
read_clients = yes

# Table to keep radius client info
client_table = "nas"

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

[email protected][~]# nano /etc/freeradius/3.0/mods-config/sql/main/mysql/queries.conf

Uncomment default_user_profile = “DEFAULT”

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

[email protected][~]# nano /etc/freeradius/3.0/sites-available/default

At authorize change -sql to sql  at accounting change -sql to sql

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

[email protected][~]# systemctl stop freeradius
[email protected][~]# freeradius -X
[email protected][~]# ps aux | grep radi
[email protected][~]# kill -9 25042
[email protected][~]# systemctl start freeradius
[email protected][~]# systemctl enable freeradius
[email protected][~]# systemctl restart freeradius.service

INSTALL AND CONFIGURE DALORADIUS

dablo radius logo

INSTALLATION OF APACHE2 SERVER

[email protected][~]# sudo apt-get -y install apache2
[email protected][~]# sudo apt-get install php7.3-db
[email protected][~]# cd /var/www/html
[email protected][~]# wget https://sourceforge.net/projects/daloradius/files/latest/download
[email protected][~]# unzip master.zip
[email protected][~]# mv daloradius-master daloradius
[email protected][~]# cd daloradius
[email protected][~]# sudo mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql
[email protected][~]# sudo mysql -u root -p radius < contrib/db/mysql-daloradius.sql
[email protected][~]# sudo chown -R www-data:www-data /var/www/html/daloradius/
[email protected][~]# sudo chmod 664 /var/www/html/daloradius/library/daloradius.conf.php
[email protected][~]# sudo nano /var/www/html/daloradius/library/daloradius.conf.php

Adjust the MySQL database information

$configValues['CONFIG_DB_HOST'] = 'localhost';
$configValues['CONFIG_DB_PORT'] = '3306';
$configValues['CONFIG_DB_USER'] = 'radius';
$configValues['CONFIG_DB_PASS'] = '[email protected]';
$configValues['CONFIG_DB_NAME'] = 'radius';

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

[email protected][~]# sudo systemctl restart freeradius.service apache2

Open Admin link using your system IP address or domain name:

http://ip-address/daloradius/login.php

A page like this will appear:

dablo login

Default login details are:

Username: administrator
Password: radius
dablo dashboard

[email protected][~]# sudo tail -f  /var/log/freeradius/radius.log

Author

Peter Donkor