Install FreeRadius MySQL on Debian or Ubuntu

Remote Authentication Dial-In User Service (RADIUS) is a networking protocol,

Install FreeRadius MySQL on Debian or Ubuntu

Remote Authentication Dial-In User Service (RADIUS) is a networking protocol, operating on port 1812, that provides centralized Authentication, Authorization, and Accounting (AAA or Triple A) management for users who connect and use a network service. RADIUS was developed by Livingston Enterprises, Inc. in 1991 as an access server authentication and accounting protocol and later brought into the Internet Engineering Task Force (IETF) standards. Wikipedia

Open Terminal / Login SSH Account

sudo apt update && upgrade -y

Install FreeRadius 3.0 MySQL

sudo apt install freeradius freeradius-utils freeradius-mysql

Enable SQL Connection

sudo cd /etc/freeradius/3.0/mods-enabled
sudo ln -s ../mods-available/sql sql

Delete -sql and #sql code on sites default

sudo nano /etc/freeradius/3.0/sites-available/default

Delete -sql and #sql code on sites inner-tunnel

sudo nano /etc/freeradius/3.0/sites-available/inner-tunnel

Create and Import Schema

mysql -u root -p -e "CREATE DATABASE radius;"
mysql -u root -p radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql

Edit FreeRadius connection

sudo nano /etc/freeradius/3.0/mods-available/sql
driver = "rlm_sql_mysql"
dialect = "mysql"
server = "localhost"
port = 3306
login = "radius"
password = "radpass"
radius_db = "radius"
read_clients = yes
client_table = "nas"

Enable FreeRadius Service

sudo systemctl start freeradius
sudo systemctl enable freeradius
sudo systemctl status freeradius

Check FreeRadius configuration

freeradius -X

Open your phpMyAdmin and create user on database radius

INSERT INTO radcheck VALUES (1, 'demo', 'Cleartext-Password', ':=', '12345');
INSERT INTO radcheck VALUES (2, 'test', 'Cleartext-Password', ':=', '54321');

Check user

sudo radtest demo 12345 localhost 10 testing123
sudo radtest test 54321 localhost 10 testing123

Video Tutorial

Related Post

Install Webserver on Debian or Ubuntu
Enable SQLCounter FreeRadius
Install FreeRadius PgSQL on Debian or Ubuntu
Install MariaDB on Debian or Ubuntu
Install PostgreSQL on Debian or Ubuntu

Comments

There are 3 comments on this post

  • avatar
    Reply
    Dharmesh Chauhan
    14 Aug, 2023 - 16:44
    User not disconnect after acees-period reach. Any help really appreciate.
    • avatar
      Reply
      MangoSpot
      14 Aug, 2023 - 16:54
      Hotspot or PPP?
  • avatar
    Reply
    Cakra
    01 Mar, 2024 - 07:36
    i got error recieved access-reject, any suggest?

Leave A Comment