我使用 mysql 和 fortigate 配置了 freeradius,当我授权一个用户时,一切都很顺利,但是 radacct 表是空的,并且没有插入任何数据,我不知道哪里出了问题,即使我取消注释了 sql int/etc/freeradius/sites-enabled/default 当我运行时,在帐户、授权和会话部分中 自由半径-X命令命令行的结果是
Going to the next request
Ready to process requests.
rad_recv: Accounting-Request packet from host 192.168.3.1 port 1029, id=28, length=102
Acct-Status-Type = Start
Acct-Session-Id = "0abf623e"
User-Name = "zaib"
NAS-Identifier = "ftg"
Framed-IP-Address = 192.168.3.2
Fortinet-Client-IP-Address = 192.168.3.2
Fortinet-Vdom-Name = "root"
Calling-Station-Id = "192.168.3.2"
Event-Timestamp = "Jun 19 2017 13:21:57 +03"
Acct-Delay-Time = 25
Executing section preacct from file /etc/freeradius/sites-enabled/default
+group preacct {
++[preprocess] = ok
[acct_unique] WARNING: Attribute NAS-Port was not found in request, unique ID
MAY be inconsistent
[acct_unique] Hashing ',NAS-Identifier = "ftg",NAS-IP-Address =
192.168.3.1,Acct-Session-Id = "0abf623e",User-Name = "zaib"'
[acct_unique] Acct-Unique-Session-ID = "e208d05f34bb9f17".
++[acct_unique] = ok
[suffix] No '@' in User-Name = "zaib", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] = noop
+} # group preacct = ok
Executing section accounting from file /etc/freeradius/sites-enabled/default
+group accounting {
[detail] expand: %{Packet-Src-IP-Address} -> 192.168.3.1
[detail] expand: /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-
%{Packet-Src-IPv6-Address}}/detail-%Y%m%d ->
/var/log/freeradius/radacct/192.168.3.1/detail-20170619
[detail] /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-
IPv6-Address}}/detail-%Y%m%d expands to
/var/log/freeradius/radacct/192.168.3.1/detail-20170619
[detail] expand: %t -> Mon Jun 19 13:21:57 2017
++[detail] = ok
[radutmp] expand: /var/log/freeradius/radutmp ->
/var/log/freeradius/radutmp
[radutmp] expand: %{User-Name} -> zaib
rlm_radutmp: No NAS-Port seen. Cannot do anything.
rlm_radumtp: WARNING: checkrad will probably not work!
++[radutmp] = noop
[sradutmp] expand: /var/log/freeradius/sradutmp ->
/var/log/freeradius/sradutmp
[sradutmp] expand: %{User-Name} -> zaib
rlm_radutmp: No NAS-Port seen. Cannot do anything.
rlm_radumtp: WARNING: checkrad will probably not work!
++[sradutmp] = noop
rlm_checkval: Item Name: Calling-Station-Id, Value: 192.168.3.2
rlm_checkval: Could not find attribute named Calling-Station-Id in check pairs
++[checkval] = notfound
+} # group accounting = notfound
Finished request 12.
Cleaning up request 12 ID 28 with timestamp +59
Going to the next request
答案1
您没有在任何地方调用 sql 模块,因此它不会将记录插入到您的数据库中。编辑raddb/sites-available/default
,查找该accounting {}
部分。
找到前面带有哈希的 sql 调用# sql
。删除哈希,这样该行就只是sql
。
假设您已正确配置 SQL 模块,服务器现在将把会计记录插入到您的数据库中。