Hi i have been tinkering with these accounting packets and just need some advice on some of the accounting packets received In the radacct table I have a record as below that remains unchanged after the accounting packet was received below. Can someone till me why it was not updated. radacctid 1 acctsessionid 5B801BCC-00000010 acctuniqueid e84e9ded57796454f371015633165f57 username ryan groupname realm nasipaddress . 190.213.227.180 nasportid 8 nasporttype Wireless-802.11 acctstarttime 2018-09-10 15:35:06 acctupdatetime . 2018-09-10 15:35:06 acctstoptime . NULL acctinterval NULL acctsessiontime . 0 acctauthentic RADIUS connectinfo_start . CONNECT 54Mbps 802.11g connectinfo_stop . acctinputoctets . 0 acctoutputoctets . 0 calledstationid . 10-6F-3F-0C-00-CE:Ryan6-Radius callingstationid . 24-18-1D-9D-72-42 acctterminatecause servicetype framedprotocol framedipaddress (43) Cleaning up request packet ID 167 with timestamp +47 Waking up in 0.1 seconds. (49) Received Accounting-Request Id 207 from 190.213.227.180:50336 to 198.58.110.29:1813 length 211 (49) Acct-Status-Type = Stop (49) Acct-Authentic = RADIUS (49) User-Name = "ryan" (49) NAS-Identifier = "Ryan6" (49) Called-Station-Id = "10-6F-3F-0C-00-CE:Ryan6-Radius" (49) NAS-Port-Type = Wireless-802.11 (49) NAS-Port = 8 (49) Calling-Station-Id = "24-18-1D-9D-72-42" (49) Connect-Info = "CONNECT 54Mbps 802.11g" (49) Acct-Session-Id = "5B801BCC-00000010" (49) WLAN-Pairwise-Cipher = 1027076 (49) WLAN-Group-Cipher = 1027076 (49) WLAN-AKM-Suite = 1027073 (49) Acct-Session-Time = 12 (49) Acct-Input-Packets = 240 (49) Acct-Output-Packets = 151 (49) Acct-Input-Octets = 32192 (49) Acct-Output-Octets = 37285 (49) Event-Timestamp = "Sep 10 2018 15:35:19 AST" (49) Acct-Terminate-Cause = User-Request (49) # Executing section preacct from file /etc/freeradius/3.0/sites-enabled/default (49) preacct { (49) [preprocess] = ok (49) policy acct_unique { (49) update request { (49) Tmp-String-9 := "ai:" (49) } # update request = noop (49) if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) && ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) { (49) EXPAND %{hex:&Class} (49) --> (49) EXPAND ^%{hex:&Tmp-String-9} (49) --> ^61693a (49) if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) && ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) -> FALSE (49) else { (49) update request { (49) EXPAND %{md5:%{User-Name},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}} (49) --> e84e9ded57796454f371015633165f57 (49) &Acct-Unique-Session-Id := e84e9ded57796454f371015633165f57 (49) } # update request = noop (49) } # else = noop (49) } # policy acct_unique = noop (49) suffix: Checking for suffix after "@" (49) suffix: No '@' in User-Name = "ryan", looking up realm NULL (49) suffix: No such realm "NULL" (49) [suffix] = noop (49) [files] = noop (49) } # preacct = ok (49) # Executing section accounting from file /etc/freeradius/3.0/sites-enabled/default (49) accounting { (49) detail: EXPAND /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d (49) detail: --> /var/log/freeradius/radacct/190.213.227.180/detail-20180910 (49) detail: /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d expands to /var/log/freeradius/radacct/190.213.227.180/detail-20180910 (49) detail: EXPAND %t (49) detail: --> Mon Sep 10 15:35:19 2018 (49) [detail] = ok (49) [unix] = ok (49) sql: EXPAND %{tolower:type.%{Acct-Status-Type}.query} (49) sql: --> type.stop.query (49) sql: Using query template 'query' rlm_sql (sql): Reserved connection (9) (49) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} (49) sql: --> ryan (49) sql: SQL-User-Name set to 'ryan' (49) sql: EXPAND INSERT INTO radacctold SELECT * FROM radacct WHERE acctstoptime <> 'NULL' (49) sql: --> INSERT INTO radacctold SELECT * FROM radacct WHERE acctstoptime <> 'NULL' (49) sql: Executing query: INSERT INTO radacctold SELECT * FROM radacct WHERE acctstoptime <> 'NULL' (49) sql: rlm_sql_mysql: ERROR 1062 (Duplicate entry '2' for key 'PRIMARY'): 23000 (49) sql: SQL query returned: need alt query (49) sql: Trying next query... (49) sql: EXPAND DELETE FROM radacct WHERE acctstoptime IS NOT NULL (49) sql: --> DELETE FROM radacct WHERE acctstoptime IS NOT NULL (49) sql: Executing query: DELETE FROM radacct WHERE acctstoptime IS NOT NULL (49) sql: SQL query returned: success (49) sql: 1 record(s) updated rlm_sql (sql): Released connection (9) (49) [sql] = ok (49) [exec] = noop (49) attr_filter.accounting_response: EXPAND %{User-Name} (49) attr_filter.accounting_response: --> ryan (49) attr_filter.accounting_response: Matched entry DEFAULT at line 12 (49) [attr_filter.accounting_response] = updated (49) } # accounting = updated (49) Sent Accounting-Response Id 207 from 198.58.110.29:1813 to 190.213.227.180:50336 length 0 (49) Finished request (49) Cleaning up request packet ID 207 with timestamp +52 (44) Cleaning up request packet ID 168 with timestamp +47 Waking up in 0.1 seconds. (45) Cleaning up request packet ID 169 with timestamp +47 Waking up in 0.1 seconds. (46) Cleaning up request packet ID 170 with timestamp +47 Waking up in 0.1 seconds. (47) Cleaning up request packet ID 171 with timestamp +47 Ready to process requests After this the table was not updated. Can you decipher what might be wrong Thanks On Thu, 09/06/2018 07:50 AM, Alan DeKok <aland@deployingradius.com> wrote:
On Sep 6, 2018, at 7:17 AM, Ryan Raamsumair via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Thanks for the swift response After doing some checks , something is definitely wrong with some of the accesspoints that were recently put in and outfitted with openwrt . The older ones are sending an idle timeout stop accounting session to the radius server to close the account.
Problem is that the fix the for the wifi driver for these new accesspoints may be long in coming ,
Then there isn't a lot you can do.
my only next option is to adjust the radius server to possibly terminate the session that is already logged on (in radacct) when the same mac address or calling station id tries to authenticate again
That's one option. That process isn't in the default configuration because it's unusual. Many systems allow the user to log in multiple times.