Table of Contents

Installing FreeRADIUS on Ubuntu 22.04

Introduction

sudo apt-get -y install libdatetime-perl libdbd-mysql-perl libdigest-hmac-perl eapoltest libdatetime-format-rfc3339-perl
sudo apt-get -y install freeradius freeradius-mysql
# Answer yes to the question to install these packages with their dependencies
# Please note that the installation of this package generates some things that can take a lot of time on slower computers.
sudo systemctl enable freeradius
sudo systemctl start freeradius
sudo systemctl status freeradius

Configure FreeRADIUS

# Stop the service if it is already running
sudo systemctl stop freeradius
# Backup the original FreeRADIUSdirectory
sudo mv /etc/freeradius /etc/freeradius.orig
# Extract the RADIUSdesk modified FreeRADIUS directory
sudo tar xzf /var/www/html/cake4/rd_cake/setup/radius/freeradius-radiusdesk.tar.gz --directory /etc
sudo chown -R freerad. /etc/freeradius/3.0/
sudo  mkdir /var/run/freeradius
sudo chown freerad. /var/run/freeradius
sudo vi /etc/freeradius/3.0/sites-enabled/dynamic-clients
#  Echo the IP address of the client.
FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"
 
# require_message_authenticator
FreeRADIUS-Client-Require-MA = no
 
# secret
FreeRADIUS-Client-Secret = "testing123"
 
# shortname
FreeRADIUS-Client-Shortname = "%{Packet-Src-IP-Address}"
sudo vi /lib/systemd/system/freeradius.service
[Unit]
Description=FreeRADIUS multi-protocol policy server
After=syslog.target network.target
Documentation=man:radiusd(8) man:radiusd.conf(5) http://wiki.freeradius.org/ http://networkradius.com/doc/
 
[Service]
Type=forking
PIDFile=/run/freeradius/freeradius.pid
#EnvironmentFile=-/etc/default/freeradius
#ExecStartPre=/usr/sbin/freeradius $FREERADIUS_OPTIONS -Cxm -lstdout
ExecStart=/usr/sbin/freeradius $FREERADIUS_OPTIONS
Restart=on-failure
RestartSec=5
 
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload 
sudo systemctl restart freeradius
sudo systemctl status freeradius

Correction of a small error

sudo vi /usr/lib/tmpfiles.d/freeradius.conf
d /run/freeradius 750 freerad freerad -

Next steps