Установил модуль по инструкции с документации.
Сейчас появилось возле каждого IP клиента возможность выбора числа на которое можно привязать IP.
Пробую ставить значение, установились, но если обновить страницу все значения становятся пустые.
В базе все запросы выполнил.
root@localhost [nodeny]> SELECT get_ip_by_num(1, 3);
+---------------------+
| get_ip_by_num(1, 3) |
+---------------------+
| 172.16.0.100 |
+---------------------+
1 row in set (0.00 sec)
Вывод Radius при авторизации:
modules {
# Loaded module rlm_sql
# Loading module "sql" from file /usr/local/etc/raddb/mods-enabled/sql
sql {
driver = "rlm_sql_mysql"
server = "localhost"
port = 3306
login = "root"
password = <<< secret >>>
radius_db = "nodeny"
read_groups = yes
read_profiles = yes
read_clients = no
delete_stale_sessions = yes
sql_user_name = ""
default_user_profile = ""
client_query = "SELECT id,nasname,shortname,type,secret FROM nas"
authorize_check_query = "call radcheck('%{User-Name}', 0)"
authorize_reply_query = "call radreply('%{User-Name}', '%{User-Password}')"
safe_characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
auto_escape = no
accounting {
reference = "%{tolower:type.%{Acct-Status-Type}.query}"
type {
accounting-on {
}
accounting-off {
}
start {
query = "call radupdate('%{User-Name}','%{Framed-IP-Address}', 'user=%{Calling-Station-Id};nas=%{NAS-IP-Address};ses=%{Acct-Session-Id}')"
}
interim-update {
query = "call radupdate('%{User-Name}','%{Framed-IP-Address}', 'user=%{Calling-Station-Id};nas=%{NAS-IP-Address};ses=%{Acct-Session-Id}')"
}
stop {
query = "call radstop('%{User-Name}', '%{Framed-IP-Address}')"
}
}
}
post-auth {
reference = ".query"
query = "call radupdate('%{User-Name}','%{reply:Framed-IP-Address}', 'user=%{Calling-Station-Id};nas=%{NAS-IP-Address};ses=%{Acct-Session-Id}')"
}
}
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
....................
Ready to process requests
(0) Received Access-Request Id 28 from x.x.x.x:34285 to x.x.x.x:1812 length 134
(0) Service-Type = Framed-User
(0) Framed-Protocol = PPP
(0) NAS-Port = 15728656
(0) NAS-Port-Type = Ethernet
(0) User-Name = "vano+0"
(0) Calling-Station-Id = "00:5A:0A:3D:07:5D"
(0) Called-Station-Id = "nas"
(0) NAS-Port-Id = "ether5"
(0) CHAP-Challenge = 0x6703b3eda9e156c2c155240e7c419743
(0) CHAP-Password = 0x01c9bc50468195efc3642bcf93f87e055c
(0) NAS-Identifier = "nas"
(0) NAS-IP-Address = x.x.x.x
(0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/nodeny
(0) authorize {
rlm_sql (sql): Reserved connection (0)
(0) sql: EXPAND call radcheck('%{User-Name}', 0)
(0) sql: --> call radcheck('vano=2B0', 0)
(0) sql: Executing select query: call radcheck('vano=2B0', 0)
(0) sql: ERROR: rlm_sql_mysql: ERROR 1318 (Incorrect number of arguments for PROCEDURE nodeny.radcheck; expected 1, got 2): 42000
(0) sql: ERROR: Error getting check attributes
rlm_sql (sql): Released connection (0)
(0) [sql] = fail
(0) } # authorize = fail
(0) Invalid user (sql: rlm_sql_mysql: ERROR 1318 (Incorrect number of arguments for PROCEDURE nodeny.radcheck; expected 1, got 2): 42000): [vano+0] (from client nas port 15728656 cli 00:5A:0A:3D:07:5D)
(0) Using Post-Auth-Type Reject
(0) Post-Auth-Type sub-section not found. Ignoring.
(0) # Executing group from file /usr/local/etc/raddb/sites-enabled/nodeny
(0) Delaying response for 1.000000 seconds
Waking up in 0.3 seconds.
(0) (0) Discarding duplicate request from client nas port 34285 - ID: 28 due to delayed response
Waking up in 0.6 seconds.
(0) (0) Discarding duplicate request from client nas port 34285 - ID: 28 due to delayed response
Waking up in 0.3 seconds.
(0) Sending delayed response
(0) Sent Access-Reject Id 28 from x.x.x.x:1812 to x.x.x.x:34285 length 20
Waking up in 3.9 seconds.
(0) Cleaning up request packet ID 28 with timestamp +13
Ready to process requests