DaloRADIUS. Almalinux 8. FreeRADIUS 3 + DaloRADIUS: различия между версиями

Материал из Wiki
Перейти к навигации Перейти к поиску
(Новая страница: «Категория:FreeRADIUS Категория:DaloRADIUS __ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__»)
 
Строка 2: Строка 2:
[[Категория:DaloRADIUS]]
[[Категория:DaloRADIUS]]
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__
== Ссылки ==
https://bytexd.com/freeradius-centos/
== Установка и настройка ==
=== HTTPD ===
<code>dnf install -y httpd</code>
<code>systemctl enable --now httpd</code>
=== MariaDB ===
<code>dnf -y install mariadb-server</code>
<code>systemctl enable --now mariadb</code>
<code>mysql_secure_installation</code>
=== PHP ===
<code>install -y dnf-utils <nowiki>http://rpms.remirepo.net/enterprise/remi-release-8.rpm</nowiki></code>
Если необходима неумолчальная версия PHP (Умолчальная - PHP 7.2)
<code>module list php</code>
<code>module reset php</code>
<code>dnf -y install @php</code>
<code>dnf -y install php-{common,opcache,cli,gd,curl,mysqlnd,devel,pear,mbstring,xml}</code>
<code>sudo systemctl enable --now php-fpm</code>
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.
<code>dnf -y install php-pear</code>
Next we install the DB and MDB2 libraries from the PEAR repository. These are required by daloRADIUS to work.
<code>pear install DB MDB2</code>
=== FreeRADIUS ===
<code>dnf module list freeradius</code>
<code>dnf install -y @freeradius freeradius-utils freeradius-mysql</code>
<code>systemctl enable radiusd.service</code>
=== Создание сертификатов ===
<code>cd  /etc/raddb/certs</code>
<code>./bootstrap</code>
=== Создание БД ===
<code>mysql -u root -p</code>
<code>   MariaDB [(none)]> CREATE DATABASE radius;</code>
<code>   MariaDB [(none)]> GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "PassWord#1";</code>
<code>   MariaDB [(none)]> FLUSH PRIVILEGES;</code>
<code>   MariaDB [(none)]> \q</code>
<code>mysql -u root -p radius < /etc/raddb/mods-config/sql/main/mysql/schema.sql</code>
<code>ln -s /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/</code>
<code>nano /etc/raddb/mods-available/sql</code>
...
#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
}
...
<code>chgrp -h radiusd /etc/raddb/mods-enabled/sql</code>
=== Проверка FreeRADIUS ===
<code>radiusd -X</code>
=== DaloRADIUS ===
<code>cd /tmp && wget <nowiki>https://github.com/lirantal/daloradius/archive/master.zip</nowiki></code>
<code>dnf -y install unzip</code>
<code>unzip master.zip</code>
<code>sudo mv daloradius-master/ /var/www/html/daloradius</code>
<code>cd /var/www/html/daloradius</code>
<code>mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql</code>
<code>mysql -u root -p radius < contrib/db/mysql-daloradius.sql</code>
<code>chown -R apache:apache /var/www/html/daloradius/</code>
<code>cp /var/www/html/daloradius/library/daloradius.conf.php.sample /var/www/html/daloradius/library/daloradius.conf.php</code>
<code>chmod 664 /var/www/html/daloradius/library/daloradius.conf.php</code>
<code>nano /var/www/html/daloradius/library/daloradius.conf.php</code>
...
$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';
...
<code>systemctl restart radiusd.service httpd</code>
<code>systemctl status radiusd.service httpd</code>
== Работа с DaloRADIUS ==
=== Идем в веб-интерфейс ===
'''''<nowiki>http://192.168.1.11/daloradius</nowiki>'''''
administrator
radius

Версия 21:03, 9 апреля 2022


Ссылки

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