docs_beamnetworks_dev_en_linux_networking_freeradius_install
docs_beamnetworks_dev_en_linux_networking_freeradius_install
Intro
FreeRadius is an Ubuntu software that acts as a RADIUS server your router can use to give you a 802.11x network. There are
various reasons you may want to do this, but today I'll show you how to get it installed.
Documentation last verified on 1/12/24 using Ubuntu Server 22.04 LTS. All commands function as expected.
Getting Started
The first thing you'll want to do is ensure your system is up to date. You can do this by running the following commands to update
the available packages on your system.
Next, there are some packages you need to install that you might not have already. A few notable ones are php, apache2,
FreeRadius, and mariadb.
1 sudo apt install php apache2 php8.1-fpm freeradius libapache2-mod-php mariadb-server freeradius-mysql freera
Then, you need to enable and start apache2 as well as enable FreeRadius. You can do this inside of one command listed below.
1 sudo systemctl enable --now apache2 && sudo systemctl enable freeradius
Once you have apache2 enabled, you can setup the sql server (in this case mariadb server).
1 sudo mysql_secure_installation
Here's what I answered during the installation, depending on your security needs, you may want to set a root password, but in my
case it doesn't matter to me. I pasted the questions as well as my answers to them (right after the questions)
Setting up mariadb
Great, now that you have setup the server, we can start to configure the database. Depending on how you set it up, you may have to
enter your sql root password on this first command, but since I clicked enter through the prompt, I will just type in sudo mysql . If
you entered a root password, type in the command below.
Next we need to create the user account. I would recommend changing PASSWORD to a secure password.
Finally, run these commands to reload the privileges in the sql database and to quit the session.
1 FLUSH PRIVILEGES;
2 quit;
To finish setting up the database, we need to connect it to FreeRadius. To tell FreeRadius we will use sql for our logins, run these
commands below one at a time. You cannot paste all these in at once.
sudo su -
exit
There are a few things you need to change before entering in the login. Below are the things that need changed. Scroll through and
make the necessary changes.
One last thing, find the section that looks like this:
And comment out all the TLS settings to make it look like this:
Now you can enter in the login. Find the section that looks like this:
And uncomment the lines that say server, port, login, and password. (Note: Uncommenting means removing the #). Enter in your
radius user password for your SQL database in the “” where it says “radpass”.
When it comes up with the automated installer, select apache2, enter in your sql settings, and boom, you're done.
Run these commands SEPARATELY and find the SECOND OCCURRENCE of “use_tunneled_reply” in the file that'll open..
In the second occurrence of “use_tunneled_reply", under the “peap” section, change NO to YES. This will allow UniFi to dynamically
assign users's vlans based on their login stored in the SQL database.
Good to know
One last thing, every time you make a change in your FreeRadius settings (that includes every time you add or modify a user) you
need to reload your settings. You can do that by running this command below:
Here are the three files you need to transfer over. Transfer them AFTER you setup your new server, then remove the files from the
new server, copy from old, and restart Freeradius.
1 /etc/ssl/private/ssl-cert-snakeoil.key
2 /etc/ssl/certs/ssl-cert-snakeoil.pem
3 /etc/ssl/certs/ca-certificates.crt
Note: Unsure if the last one matters or not, haven't tried it. Doesn't seem to “hurt” anything if it is copied over.
Comments
Irwan Mahardika
A YEAR AGO
IM
thank, hope can view daloradius tutorial page
Administrator
A YEAR AGO
A
You should be able to view that page now that the video is published.
Mirza
8 MONTHS AGO
M Hi dear.
I installed exactly the same way but the error showing in (Mikrotik) NAS "user authentication failed radius timeout".
Not accepting request. Will you install and connect me to Mikrotik?