mbRadius

Файловая структура

В разных версиях OS пути отличаются

  • Centos путь /etc/raddb

  • Debian путь /etc/freeradius/v3

/etc/raddb/
├── core.pl
├── dictionary
├── hints
├── huntgroups
├── mods-available
│   └── perl
├── mods-config
│   └── perl
│       └── example.pl
├── mods-enabled
├── modules
│   ├── acct_unique
│   ├── always
│   ├── chap
│   ├── detail
│   ├── detail.log
│   ├── expiration
│   ├── expr
│   ├── linelog
│   ├── logintime
│   ├── mschap
│   ├── pap
│   ├── perl
│   ├── preprocess
│   ├── radutmp
│   ├── realm
│   ├── sradutmp
│   └── unix
├── radiusd.conf
├── serialize.pm
├── sites-enabled
│   ├── billing
│   └── dhcp
├── sql.conf
└── sql_queue.conf

Описание директорий и файлов

файл/директория

описание

/etc/raddb/

директория radius

/etc/raddb/core.pl

perl модуль для соединения с ядром биллинга

/etc/raddb/dictionary

файл словарей (ведет к /usr/share/freeradius/dictionary)

/etc/raddb/hints

https://wiki.freeradius.org/config/Hints

/etc/raddb/huntgroups

https://wiki.freeradius.org/config/huntgroups

/etc/raddb/mods-available

директория доступных модулей radius

/etc/raddb/mods-enabled

директория включенных модулей radius

/etc/raddb/mods-config

https://networkradius.com/doc/3.0.10/raddb/mods-config/home.html

/etc/raddb/modules

текущие модули radius

/etc/raddb/radiusd.conf

файл с настройками radius

/etc/raddb/serialize.pm

perl модуль для обработки данных

/etc/raddb/sites-enabled

директория включенных сервисов radius

/etc/raddb/sites-enabled/billing

сервис биллинга

/etc/raddb/sites-enabled/dhcp

сервис DHCP

/etc/raddb/sql.conf

файл настроек подключения к базе данных

/etc/raddb/sql_queue.conf

файл с sql запросами radius к базе данных

Файлы конфигурации

Файл core.pl содержит переменные $host и $port для подключения к ядру биллинга

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
use IO::Socket;
use locale;
use POSIX;
use serialize;

setlocale(LC_ALL, 'C');
use constant    RLM_MODULE_REJECT=>  0;#  /* immediately reject the request */
use constant  RLM_MODULE_FAIL=>      1;#  /* module failed, don't reply */
use constant  RLM_MODULE_OK=>        2;#  /* the module is OK, continue */
use constant  RLM_MODULE_HANDLED=>   3;#  /* the module handled the request, so stop. */
use constant  RLM_MODULE_INVALID=>   4;#  /* the module considers the request invalid. */
use constant  RLM_MODULE_USERLOCK=>  5;#  /* reject the request (user is locked out) */
use constant  RLM_MODULE_NOTFOUND=>  6;#  /* user not found */
use constant  RLM_MODULE_NOOP=>      7;#  /* module succeeded without doing anything */
use constant  RLM_MODULE_UPDATED=>   8;#  /* OK (pairs modified) */
use constant  RLM_MODULE_NUMCODES=>  9;#  /* How many return codes there are */

use constant  RADIUS_L_DBG=>         0;# /* debug log  */
use constant  RADIUS_L_AUTH=>        1;# /* auth log   */
use constant  RADIUS_L_PROXY=>       2;# /* peroxy log */
use constant  RADIUS_L_INFO=>        3;# /* info log   */
use constant  RADIUS_L_ERROR=>       4;# /* error log  */

# mbcore daemon IP address and port
my $host="127.0.0.1";
my $port="22007";

Файл sql.conf содержит переменные server, port, login, password, radius_db для подключения к базе данных

1
2
3
4
5
6
7
8
sql {
      database = "mysql"
      driver = "rlm_sql_${database}"
      server = "127.0.0.1"
      port = 3306
      login = "user_name"
      password = "user_password"
      radius_db = "database_name"

При возникновении проблем, сообщите о них в нашем CRM или Telegram канале.