Installation FreeRADIUS | The most popular RADIUS server

Btech Engineering
btech-engineering
Published in
3 min readSep 30, 2022

Solutions for RADIUS server

freeradius.org

Introduction

FreeRADIUS is an open source, high-performance, modular, scalable and feature-rich RADIUS server. It ships with both server and radius client, development libraries and numerous additional RADIUS related utilities. 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.

Requirement

Ubuntu Server 22/20/18.04

Step By Step

1. Update system package

sudo apt updatesudo apt -y upgrade

2. Install apache and php

sudo apt -y install apache2sudo apt -y install php libapache2-mod-php php-{gd,common,mail,mail-mime,mysql,pear,db,mbstring,xml,curl}php -v

3. Install mariadb and create database

sudo apt updatesudo apt install mariadb-server# setup mysqlsudo mysql_secure_installation# create databasesudo mysql -u root -pCREATE DATABASE radius;GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "StrongPassword";FLUSH PRIVILEGES;QUIT

4. Install and config FreeRADIUS

  • Check Available version
sudo apt policy freeradiusfreeradius:Installed: 3.0.20+dfsg-3build1Candidate: 3.0.20+dfsg-3build1Version table:*** 3.0.20+dfsg-3build1 500500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages100 /var/lib/dpkg/statussudo apt -y install freeradius freeradius-mysql freeradius-utils
  • Import freeradius database scheme
sudo su -mysql -u root -p radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql
  • Verify
sudo  mysql -u root -p -e "use radius;show tables;"
  • Create link for sql module
sudo ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/
  • Configure Sql Module
sudo vim /etc/freeradius/3.0/mods-enabled/sql...sql {driver = "rlm_sql_mysql"dialect = "mysql"
  • 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 infoclient_table = "nas"
  • Comment SSL sections in mysql
mysql {
# If any of the files below are set, TLS encryption is enabled
# tls {
# ca_file = "/etc/ssl/certs/my_ca.crt"
# ca_path = "/etc/ssl/certs/"
# certificate_file = "/etc/ssl/certs/private/client.crt"
# private_key_file = "/etc/ssl/certs/private/client.key"
# cipher = "DHE-RSA-AES256-SHA:AES128-SHA"
#
# tls_required = yes
# tls_check_cert = no
# tls_check_cert_cn = no
# }
# If yes, (or auto and libmysqlclient reports warnings are
# available), will retrieve and log additional warnings from
# the server if an error has occured. Defaults to 'auto'
warnings = auto
}
  • Change group
sudo chgrp -h freerad /etc/freeradius/3.0/mods-available/sqlsudo chown -R freerad:freerad /etc/freeradius/3.0/mods-enabled/sql
  • Restart freeradius service
sudo systemctl restart freeradius.service
  • Verify Installation FreeRADIUS
sudo systemctl status freeradius

Install DoloRadius

DaloRADIUS is an advanced RADIUS web management platform written in PHP and JavaScript. Install Daloradius to get FreeRADIUS web administration interface.

1. Install DoloRADIUS package

sudo apt -y install wget unzipwget https://github.com/lirantal/daloradius/archive/master.zipunzip master.zipmv daloradius-master daloradiuscd daloradius

2. Configure DoloRADIUS

  • Import daloRadius tables
sudo mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sqlsudo mysql -u root -p radius < contrib/db/mysql-daloradius.sql
  • Configure daloradius database connection
cd ..sudo mv daloradius /var/www/html/sudo mv /var/www/html/daloradius/library/daloradius.conf.php.sample /var/www/html/daloradius/library/daloradius.conf.phpsudo chown -R www-data:www-data /var/www/html/daloradius/sudo chmod 664 /var/www/html/daloradius/library/daloradius.conf.php
  • Modify config file
sudo vim /var/www/html/daloradius/library/daloradius.conf.php...$configValues['CONFIG_DB_HOST'] = 'localhost';$configValues['CONFIG_DB_PORT'] = '3306';$configValues['CONFIG_DB_USER'] = 'radius';$configValues['CONFIG_DB_PASS'] = 'StrongPassword';$configValues['CONFIG_DB_NAME'] = 'radius';

3. Restart apache

sudo systemctl restart freeradius.service apache2

4. Verify DoloRADIUS

access to http://[Ip server]/doloradius/login.php

Reference

https://computingforgeeks.com/how-to-install-freeradius-and-daloradius-on-ubuntu/

Our Tagline

# Together is Better & Continuous Learning

Author:

Muhammad Fauzan Rafi, Staff of Research | Linkedln

Based On Documentation Research:

Razzaaq Arditian, Staff of Research | LinkedIn

--

--

Btech Engineering
btech-engineering

Our mission is continuous learning and remember together is better.