DaloRADIUS. Almalinux 8. FreeRADIUS 3 + DaloRADIUS
Ссылки
https://bytexd.com/freeradius-centos/
Установка и настройка
HTTPD
dnf install -y httpd
systemctl enable --now httpd
MariaDB
dnf -y install mariadb-server
systemctl enable --now mariadb
mysql_secure_installation
PHP
install -y dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Если необходима неумолчальная версия PHP (Умолчальная - PHP 7.2)
module list php
module reset php
dnf -y install @php
dnf -y install php-{common,opcache,cli,gd,curl,mysqlnd,devel,pear,mbstring,xml}
sudo systemctl enable --now php-fpm
If you also intend to install daloRADIUS, the freeRADIUS GUI, you’ll also need to install PEAR, a PHP extension, from which we’ll install some dependencies.
dnf -y install php-pear
Next we install the DB and MDB2 libraries from the PEAR repository. These are required by daloRADIUS to work.
pear install DB MDB2
FreeRADIUS
dnf module list freeradius
dnf install -y @freeradius freeradius-utils freeradius-mysql
systemctl enable radiusd.service
Создание сертификатов
cd /etc/raddb/certs
./bootstrap
Создание БД
mysql -u root -p
MariaDB [(none)]> CREATE DATABASE radius;
MariaDB [(none)]> GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "PassWord#1";
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q
mysql -u root -p radius < /etc/raddb/mods-config/sql/main/mysql/schema.sql
ln -s /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/
nano /etc/raddb/mods-available/sql
...
#dialect = "sqlite"
dialect = "mysql"
#driver = "rlm_sql_null"
driver = "rlm_sql_mysql"
server = "127.0.0.1"
port = 3306
login = "radius"
password = "radius_123"
radius_db = "radius"
# Clients will ONLY be read on server startup.
read_clients = yes
# Table to keep radius client info
client_table = "nas"
...
# COMMENT tls SECTION
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
}
...
chgrp -h radiusd /etc/raddb/mods-enabled/sql
Проверка FreeRADIUS
radiusd -X
DaloRADIUS
cd /tmp && wget https://github.com/lirantal/daloradius/archive/master.zip
dnf -y install unzip
unzip master.zip
sudo mv daloradius-master/ /var/www/html/daloradius
cd /var/www/html/daloradius
mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql
mysql -u root -p radius < contrib/db/mysql-daloradius.sql
chown -R apache:apache /var/www/html/daloradius/
cp /var/www/html/daloradius/library/daloradius.conf.php.sample /var/www/html/daloradius/library/daloradius.conf.php
chmod 664 /var/www/html/daloradius/library/daloradius.conf.php
nano /var/www/html/daloradius/library/daloradius.conf.php
... $configValues['FREERADIUS_VERSION'] = '3'; $configValues['CONFIG_DB_ENGINE'] = 'mysqli'; $configValues['CONFIG_DB_HOST'] = 'localhost'; $configValues['CONFIG_DB_PORT'] = '3306'; $configValues['CONFIG_DB_USER'] = 'root'; $configValues['CONFIG_DB_PASS'] = 'EkviZlo159'; $configValues['CONFIG_DB_NAME'] = 'radius'; ...
systemctl restart radiusd.service httpd
systemctl status radiusd.service httpd
Работа с DaloRADIUS
Идем в веб-интерфейс
http://192.168.1.11/daloradius
administrator
radius