What is FreeRADIUS?

FreeRADIUS is very popular open-source RADIUS server. It’s been developed since the dial-up era, and it’s still going strong today, being used by a great deal of companies around the world, including many Fortune 500 companies.

FreeRADIUS supports all of the authentication protocols and offers the AAA protocols ( Authentication, Authorization, and accounting). It’s typically used for managing users and keeping track of bandwidth usage, and it’s a popular solution for networking software such as OpenVPN, SoftEther, Squid Proxies and WiFi hotspots.

In this tutorial we’ll install FreeRADIUS on a machine running Debian 9. We’ll also configure it to use MySQL, and we’ll install daloRADIUS which is an open-source control panel for managing your RADIUS server.

Should you want to use a different operating system, do visit one of our other tutorials:

How to set up FreeRADIUS?

We present 2 methods to set up your RADIUS server:

1. Manual FreeRADIUS Install – By following this tutorial you’ll be setting up FreeRADIUS on a Debian 9 machine. Along with other configurations you may need to make, this may take 30 minutes if you’re familiar with FreeRADIUS to several hours if you’re just starting.

2. Instant FreeRADIUS Server Deployment – You can deploy your server instantly and it will have FreeRADIUS + MySQL + daloRADIUS set up in less than 5 minutes, by using our FreeRADIUS KVM Servers. Should you also need it, you can also opt for our priority support addon which will ensure that you receive our assistance with any RADIUS related issue from then on.

Method 1 – Instant FreeRADIUS Server Deloyment

If you need to set up RADIUS servers fast and don’t have time to learn the intricacies of the software, then you can rely on our FreeRADIUS Server Plans. All you have to do is choose one of the available packages, and one of our available addons if needed, and the server will be set up in less than 5 minutes. After which, you’ll see all your related credentials the first time you SSH onto the server.

Pre-Installed FreeRADIUS Servers

Automatic FreeRADIUS 3 + daloRADIUS Set Up

Instantly deploy machines with FreeRADIUS + MySQL + daloRADIUS GUI Panel already set up, receive the credentials and take over from there! You also get our custom WHMCS Module to help you manage it from our dashboard.

Pick one of our FreeRADIUS KVM plans


P.S. We're available for hire, if you need help. Click here to contact us.

Method 2 – Manual FreeRADIUS Install

Should you choose to install manually, then we’ve got you covered. Should you encounter any issues with following this tutorial, then hit us up and we’ll try to help solve the problem as soon as we can.

Without further ado, let’s get to setting up our RADIUS server.

Install LAMP Stack on Debian 9

NOTE: If you already have LAMP Stack installed on your Dabian 9 machine, or don’t want to install the daloRADIUS FreeRADIUS GUI, then feel free to skip to the FreeRADIUS installation

Before anything else, make sure you update & upgrade your system.:

Install Apache

Apache should be running right away. To check it’s status run the following:

You can also check that Apache is running by visiting http://your_server_ip_or_domain, and should see something like the following screenshot:

apache-installed

Install MySQL on Debian 9

Install MySQL by running the following command:

MySQL comes with a script that helps you change some insecure defaults, such as:

  • setting root password
  • removing anonymous users
  • disallowing remote login
  • removing test database

Run the script with the command:

We recommend you answer the prompts as follows.

First press enter when prompted for the root password:

Confirm that you want to set the root password and then set a complicated password for MySQL.

Confirm removing anonymous users.

Disallow root login remotely.

Remove the test database.

Reload privilege tables.

At this point, MySQL should be successfully set up on your Debian 9 machine.

Install PHP on Debian 9

Run the following command to install PHP and common extensions:

Now configure Apache so it processes PHP content. Do this by editing the file /etc/apache2/mods-available/dir.conf in your favorite text editor:

To configure Apache to process PHP, add index.php as the first value of DirectoryIndex.

Save and close the file when you’re done.

Finally restart Apache:

Install FreeRADIUS on Debian 9

Install FreeRADIUS and it’s dependencies:

Enable FreeRADIUS so it runs after you restart the system:

For now stop FreeRADIUS so you can run it in debug mode and check if everything’s running correctly:

Next, run FreeRADIUS in debug mode:

If everything’s working OK, the output should be something like this:

Log into the MySQL console as root:

Create a database and user for RADIUS:

Next, import the FreeRADIUS database schema that shipped with FreeRADIUS – it’s located at /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql:

Enable the FreeRADIUS SQL module by creating a symbolic link to the sql module from /etc/freeradius/3.0/mods-available/ to mods-enabled:

Open /etc/freeradius/3.0/mods-available/sql with your favorite editor…

Change the following values, as well as uncommenting them by removing the # sign at the beginning of their lines:

Look for the line locating read_clients = yes. You’ll probably see that it starts with a # sign, which means that it’s commented out. Delete the # sign to enable FreeRADIUS to read clients from the database. It should look like this after you’re done:

Save and exit the file when you’re done.

Change the ownership and group for the SQL module to freerad with the following command:

Restart FreeRADIUS:

Install daloRADIUS on Debian 9

daloRADIUS is an open-source, advanced RADIUS web control panel. It provides an easy interface for managing users, graphical reporting, accounting, a billing engine, and it integrates with Google Maps. Common uses for daloRADIUS are managing ISP deployments and hotspots.

Prerequisites

First, install some required PHP extensions:

Install the PHP Pear DB library:

Install daloRADIUS

Download the latest version of daloRADIUS from the daloRADIUS Project page on SourceForge.

The current latest version of daloRADIUS available there is daloRADIUS 0.9-9. To download it run the following command:

Once downloaded, extract the archive using the following command:

And move the daloRADIUS folder to the root directory of your server:

Add the daloRADIUS SQL schema:

Change the owner of the daloRADIUS configuration files:

Change the permissions of the main daloRADIUS configuration file to 664:

Open the daloRADIUS configuration file and change the database connection parameters as follows:

Do make sure you’ve changed $configValues['CONFIG_DB_ENGINE'] = 'mysql'; to $configValues['CONFIG_DB_ENGINE'] = 'mysqli';, or else you may get an error when trying to log into daloRADIUS:

Save and close the file when you’re finished, and restart freeRADIUS:

Verifying daloRADIUS Installation

At this point daloRADIUS should be installed on your Debian 9 machine.

To test and use it, visit http://domain_or_server_IP/daloradius in your browser. In my case, I’m visiting:

daloradius_debian_1

The default login credentials are:

Username: Administrator

Password: radius

daloradius_debian_dashboard

Testing FreeRADIUS

FreeRADIUS and daloRADIUS should now be installed and configured. To make sure that the server works, we’ll create a user from the web panel and then send an Authentication request to the server.

Create NAS Client & User

For another computer to connect to our RADIUS server, it needs to be added to the NAS Client Table in the RADIUS database.

We’re just starting, so we’ll need to add a new NAS. Do this by first navigating to Management > NAS > New NAS.

Now add a new User by navigating to Management > Users > New Users and filling the form similarly to the following:

There are more attributes you can add to users and groups, but that’s beyond the scope of this tutorial.

Now we should test the NAS and User. Remember that every time a NAS is added, you need to restart FreeRADIUS so it fetches the updated table.

To test our setup, we’ll have to run in debug mode to check out the output. However, FreeRADIUS is probably still running. So to run it in debug mode we’ll have to stop the running service and start it in debug mode using the -X flag:

You’ll see something like this:

Test with NTRadPing

To test our server we can use a nice tool called NTRadPing. You can download it here: ntradping.

To run it, just unzip the archive and run the executable. Fill it with the credentials you created earlier, while keeping in mind that the port RADIUS uses is 1812:

RADIUS Server/port: your_server_ip / 1812
RADIUS Secret Key: strongsecret!
Password: Strongpassword

And check the CHAP checkbox.

radius_test_ntradping

Now click send in NTRadPing. The output in NTRadPing should look something like this:

The output on the RADIUS server should look something like this:

Conclusion

And that’s it. You’ve successfully installed FreeRADIUS + daloRADIUS with MySQL on Debian 9.

Should you encounter any issues, don’t hesitate to get in touch with and we’ll do our best to be of assistance.

Pre-Installed FreeRADIUS Servers

Automatic FreeRADIUS 3 + daloRADIUS Set Up

Instantly deploy machines with FreeRADIUS + MySQL + daloRADIUS GUI Panel already set up, receive the credentials and take over from there! You also get our custom WHMCS Module to help you manage it from our dashboard.

Pick one of our FreeRADIUS KVM plans


P.S. We're available for hire, if you need help. Click here to contact us.


Vlad

Tech Support

Leave a Comment

LIMITED TIME SPECIAL 💀

Enter your email below to get 20% OFF on any of our Linux VPS plans and receive weekly deals on our services!