Framed IP and and Protocol in SQL written as Null

Saied Ahadi saiedahadi at gmail.com
Wed Oct 16 12:44:28 UTC 2024


I am having some trouble moving from FR2 to FR3. I did a fresh install
recently on FR3. Authentication part is working correctly. However I
noticed that most of the time the Framed IP address and FramedProtocol are
not written correctly into the mysql database. I am sure I have incorrectly
setup something but since I don't understand how I can go ahead and trouble
shoot this matter.

Here are the logs use freeradius -X

BlastRADIUS check: Received packet without Message-Authenticator.
YOU MUST SET "require_message_authenticator = true", or
YOU MUST SET "limit_proxy_state = true" for client pubip
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The packet does not contain Message-Authenticator, which is a security issue
UPGRADE THE CLIENT AS YOUR NETWORK IS VULNERABLE TO THE BLASTRADIUS ATTACK.
Once the client is upgraded, set "require_message_authenticator = true" for
client pubip
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(0) Received Access-Request Id 91 from 143.198.146.8:56216 to
67.205.156.27:1812 length 186
(0)   Service-Type = Framed-User
(0)   Framed-Protocol = PPP
(0)   NAS-Port = 15728640
(0)   NAS-Port-Type = Ethernet
(0)   User-Name = "saied"
(0)   Calling-Station-Id = "0C:DC:B7:B1:00:00"
(0)   NAS-Port-Id = "ether2"
(0)   Acct-Session-Id = "81b00000"
(0)   MS-CHAP-Challenge = 0x1e86ccb35ca835cd91f0010ed05ef9f8
(0)   MS-CHAP2-Response =
0x0100b82b5ae17cd5f3d5c529bd97d16f686d0000000000000000d6856ebb6089ace13cb4d8e5dccdb75bc2ab423d994b19d8
(0)   NAS-Identifier = "MikroTik"
(0)   NAS-IP-Address = 192.168.122.30
(0) # Executing section authorize from file
/etc/freeradius/sites-enabled/default
(0)   authorize {
(0)     policy filter_username {
(0)       if (&User-Name) {
(0)       if (&User-Name)  -> TRUE
(0)       if (&User-Name)  {
(0)         if (&User-Name =~ / /) {
(0)         if (&User-Name =~ / /)  -> FALSE
(0)         if (&User-Name =~ /@[^@]*@/ ) {
(0)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(0)         if (&User-Name =~ /\.\./ ) {
(0)         if (&User-Name =~ /\.\./ )  -> FALSE
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   ->
FALSE
(0)         if (&User-Name =~ /\.$/)  {
(0)         if (&User-Name =~ /\.$/)   -> FALSE
(0)         if (&User-Name =~ /@\./)  {
(0)         if (&User-Name =~ /@\./)   -> FALSE
(0)       } # if (&User-Name)  = notfound
(0)     } # policy filter_username = notfound
(0)     [preprocess] = ok
(0)     [chap] = noop
(0) mschap: Found MS-CHAP attributes.  Setting 'Auth-Type  = mschap'
(0)     [mschap] = ok
(0)     [digest] = noop
(0) suffix: Checking for suffix after "@"
(0) suffix: No '@' in User-Name = "saied", looking up realm NULL
(0) suffix: No such realm "NULL"
(0)     [suffix] = noop
(0) eap: No EAP-Message, not doing EAP
(0)     [eap] = noop
(0) files: sql_groupcmp
(0) files: EXPAND %{User-Name}
(0) files:    --> saied
(0) files: SQL-User-Name set to 'saied'
rlm_sql (sql): Reserved connection (1)
(0) files: EXPAND SELECT groupname FROM radusergroup WHERE username =
'%{SQL-User-Name}' ORDER BY priority
(0) files:    --> SELECT groupname FROM radusergroup WHERE username =
'saied' ORDER BY priority
(0) files: Executing select query: SELECT groupname FROM radusergroup WHERE
username = 'saied' ORDER BY priority
rlm_sql (sql): Released connection (1)
Need more connections to reach 10 spares
rlm_sql (sql): Opening additional connection (6), 1 of 26 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future
version.
rlm_sql_mysql: Connected to database 'radius' on Localhost via UNIX socket,
server version 5.5.5-10.3.39-MariaDB-0ubuntu0.20.04.2, protocol version 10
rlm_sql (sql): Closing expired connection (5) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): Closing expired connection (4) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): Closing expired connection (3) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): Closing expired connection (2) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): You probably need to lower "min"
rlm_sql (sql): Closing expired connection (0) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
(0) files: sql_groupcmp finished: User is NOT a member of group
inactive-user
(0) files: sql_groupcmp
(0) files: EXPAND %{User-Name}
(0) files:    --> saied
(0) files: SQL-User-Name set to 'saied'
rlm_sql (sql): Reserved connection (1)
(0) files: EXPAND SELECT groupname FROM radusergroup WHERE username =
'%{SQL-User-Name}' ORDER BY priority
(0) files:    --> SELECT groupname FROM radusergroup WHERE username =
'saied' ORDER BY priority
(0) files: Executing select query: SELECT groupname FROM radusergroup WHERE
username = 'saied' ORDER BY priority
rlm_sql (sql): Released connection (1)
(0) files: sql_groupcmp finished: User is NOT a member of group
multilink-active-user
(0) files: users: Matched entry DEFAULT at line 84
(0) files: users: Matched entry DEFAULT at line 186
(0)     [files] = ok
(0) sql: EXPAND %{User-Name}
(0) sql:    --> saied
(0) sql: SQL-User-Name set to 'saied'
rlm_sql (sql): Reserved connection (6)
(0) sql: EXPAND SELECT id, username, attribute, value, op FROM radcheck
WHERE username = '%{SQL-User-Name}' ORDER BY id
(0) sql:    --> SELECT id, username, attribute, value, op FROM radcheck
WHERE username = 'saied' ORDER BY id
(0) sql: Executing select query: SELECT id, username, attribute, value, op
FROM radcheck WHERE username = 'saied' ORDER BY id
(0) sql: User found in radcheck table
(0) sql: Conditional check items matched, merging assignment check items
(0) sql:   Cleartext-Password := "saied"
(0) sql: EXPAND SELECT id, username, attribute, value, op FROM radreply
WHERE username = '%{SQL-User-Name}' ORDER BY id
(0) sql:    --> SELECT id, username, attribute, value, op FROM radreply
WHERE username = 'saied' ORDER BY id
(0) sql: Executing select query: SELECT id, username, attribute, value, op
FROM radreply WHERE username = 'saied' ORDER BY id
(0) sql: EXPAND SELECT groupname FROM radusergroup WHERE username =
'%{SQL-User-Name}' ORDER BY priority
(0) sql:    --> SELECT groupname FROM radusergroup WHERE username = 'saied'
ORDER BY priority
(0) sql: Executing select query: SELECT groupname FROM radusergroup WHERE
username = 'saied' ORDER BY priority
(0) sql: User not found in any groups
rlm_sql (sql): Released connection (6)
(0)     [sql] = ok
(0)     [expiration] = noop
(0)     [logintime] = noop
(0)     [pap] = noop
(0)     if (User-Name){
(0)     if (User-Name) -> TRUE
(0)     if (User-Name) {
(0)       if ("%{sql:UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and
CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){
rlm_sql (sql): Reserved connection (1)
rlm_sql (sql): Released connection (1)
rlm_sql (sql): Reserved connection (6)
rlm_sql (sql): Released connection (6)
(0)       EXPAND %{User-Name}
(0)          --> saied
(0)       SQL-User-Name set to 'saied'
rlm_sql (sql): Reserved connection (1)
(0)       Executing query: UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='saied' and
CallingStationId='0C:DC:B7:B1:00:00' and AcctStopTime is NULL
rlm_sql_mysql: Rows matched: 0  Changed: 0  Warnings: 0
(0)       SQL query affected no rows
rlm_sql (sql): Released connection (1)
(0)       EXPAND %{sql:UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and
CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}
(0)          -->
(0)       if ("%{sql:UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and
CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}") ->
FALSE
(0)     } # if (User-Name) = ok
(0)   } # authorize = ok
(0) Found Auth-Type = mschap
(0) # Executing group from file /etc/freeradius/sites-enabled/default
(0)   authenticate {
(0) mschap: Found Cleartext-Password, hashing to create NT-Password
(0) mschap: Creating challenge hash with username: saied
(0) mschap: Client is using MS-CHAPv2
(0) mschap: Adding MS-CHAPv2 MPPE keys
(0)     [mschap] = ok
(0)   } # authenticate = ok
(0) # Executing section session from file
/etc/freeradius/sites-enabled/default
(0)   session {
(0) sql: EXPAND %{User-Name}
(0) sql:    --> saied
(0) sql: SQL-User-Name set to 'saied'
rlm_sql (sql): Reserved connection (6)
(0) sql: EXPAND SELECT COUNT(*) FROM radacct WHERE username =
'%{SQL-User-Name}' AND acctstoptime IS NULL
(0) sql:    --> SELECT COUNT(*) FROM radacct WHERE username = 'saied' AND
acctstoptime IS NULL
(0) sql: Executing select query: SELECT COUNT(*) FROM radacct WHERE
username = 'saied' AND acctstoptime IS NULL
rlm_sql (sql): Released connection (6)
(0)     [sql] = ok
(0)   } # session = ok
(0) # Executing section post-auth from file
/etc/freeradius/sites-enabled/default
(0)   post-auth {
(0)     if (session-state:User-Name && reply:User-Name && request:User-Name
&& (reply:User-Name == request:User-Name)) {
(0)     if (session-state:User-Name && reply:User-Name && request:User-Name
&& (reply:User-Name == request:User-Name))  -> FALSE
(0)     update {
(0)       No attributes updated for RHS &session-state:
(0)     } # update = noop
(0)     policy sql_session_start.post-auth {
(0)       policy acct_unique {
(0)         update request {
(0)           &Tmp-String-9 := "ai:"
(0)         } # update request = noop
(0)         if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) {
(0)         EXPAND %{hex:&Class}
(0)            -->
(0)         EXPAND ^%{hex:&Tmp-String-9}
(0)            --> ^61693a
(0)         if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i))  -> FALSE
(0)         else {
(0)           update request {
(0)             EXPAND
%{md5:%{User-Name},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}}
(0)                --> c8cfd558bded834454aa713d62999e75
(0)             &Acct-Unique-Session-Id := c8cfd558bded834454aa713d62999e75
(0)           } # update request = noop
(0)         } # else = noop
(0)         update request {
(0)           &Tmp-String-9 !* ANY
(0)         } # update request = noop
(0)       } # policy acct_unique = noop
(0) sql: EXPAND
%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}
(0) sql:    --> type.post-auth.query
(0) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (1)
(0) sql: EXPAND %{User-Name}
(0) sql:    --> saied
(0) sql: SQL-User-Name set to 'saied'
(0) sql: EXPAND INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
 acctauthentic, connectinfo_start,        connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     )
VALUES('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{SQL-User-Name}', '%{Realm}',
'%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}',
NULLIF('%{%{NAS-Port-ID}:-%{NAS-Port}}', ''), '%{NAS-Port-Type}',
FROM_UNIXTIME(%{%{integer:Event-Timestamp}:-%l}), NULL, NULL, 0, '',
'%{Connect-Info}', NULL, 0, 0, '%{Called-Station-Id}',
'%{Calling-Station-Id}', '', '%{Service-Type}', NULL, '', '', '', '', '' )
detail (/var/log/freeradius/radacct/detail_coa): Polling for detail file
detail (/var/log/freeradius/radacct/detail_coa): Detail listener state
unopened waiting 1.181563 sec
(0) sql:    --> INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
 acctauthentic, connectinfo_start,        connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     )
VALUES('81b00000', 'c8cfd558bded834454aa713d62999e75', 'saied', '',
'192.168.122.30', NULLIF('ether2', ''), 'Ethernet',
FROM_UNIXTIME(1729070924), NULL, NULL, 0, '', '', NULL, 0, 0, '',
'0C:DC:B7:B1:00:00', '', 'Framed-User', NULL, '', '', '', '', '' )
(0) sql: Executing query: INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
acctauthentic, connectinfo_start,       connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     )
VALUES('81b00000', 'c8cfd558bded834454aa713d62999e75', 'saied', '',
'192.168.122.30', NULLIF('ether2', ''), 'Ethernet',
FROM_UNIXTIME(1729070924), NULL, NULL, 0, '', '', NULL, 0, 0, '',
'0C:DC:B7:B1:00:00', '', 'Framed-User', NULL, '', '', '', '', '' )
(0) sql: SQL query returned: success
(0) sql: 1 record(s) updated
rlm_sql (sql): Released connection (1)
(0)       [sql.accounting] = ok
(0)     } # policy sql_session_start.post-auth = ok
(0) sql: EXPAND .query
(0) sql:    --> .query
(0) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (6)
(0) sql: EXPAND %{User-Name}
(0) sql:    --> saied
(0) sql: SQL-User-Name set to 'saied'
(0) sql: EXPAND INSERT INTO radpostauth (username, pass, reply, authdate )
VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}',
'%{reply:Packet-Type}', '%S.%M' )
(0) sql:    --> INSERT INTO radpostauth (username, pass, reply, authdate )
VALUES ( 'saied', '', 'Access-Accept', '2024-10-16 09:28:44.887811' )
(0) sql: Executing query: INSERT INTO radpostauth (username, pass, reply,
authdate ) VALUES ( 'saied', '', 'Access-Accept', '2024-10-16
09:28:44.887811' )
(0) sql: SQL query returned: success
(0) sql: 1 record(s) updated
rlm_sql (sql): Released connection (6)
(0)     [sql] = ok
(0)     [exec] = noop
(0)     policy remove_reply_message_if_eap {
(0)       if (&reply:EAP-Message && &reply:Reply-Message) {
(0)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(0)       else {
(0)         [noop] = noop
(0)       } # else = noop
(0)     } # policy remove_reply_message_if_eap = noop
(0)     if (EAP-Key-Name && &reply:EAP-Session-Id) {
(0)     if (EAP-Key-Name && &reply:EAP-Session-Id)  -> FALSE
(0)   } # post-auth = ok
(0) Sent Access-Accept Id 91 from 67.205.156.27:1812 to 143.198.146.8:56216
length 209
(0)   Framed-Protocol = PPP
(0)   Framed-Compression = Van-Jacobson-TCP-IP
(0)   MS-CHAP2-Success =
0x01533d36324342373731454439304334353137333343393345453730334233374442323343463941304441
(0)   MS-MPPE-Recv-Key = 0x86232b7b39c9e6b140d6daaf2bcc09ac
(0)   MS-MPPE-Send-Key = 0x93f5635e2e62404b6a8b28415c685ebc
(0)   MS-MPPE-Encryption-Policy = Encryption-Allowed
(0)   MS-MPPE-Encryption-Types = RC4-40or128-bit-Allowed
(0) Finished request
(1) Received Accounting-Request Id 92 from 143.198.146.8:53796 to
67.205.156.27:1813 length 134
(1)   Service-Type = Framed-User
(1)   Framed-Protocol = PPP
(1)   NAS-Port = 15728640
(1)   NAS-Port-Type = Ethernet
(1)   User-Name = "saied"
(1)   Calling-Station-Id = "0C:DC:B7:B1:00:00"
(1)   NAS-Port-Id = "ether2"
(1)   Acct-Session-Id = "81b00000"
(1)   Framed-IP-Address = 10.10.10.254
(1)   Acct-Authentic = RADIUS
(1)   Event-Timestamp = "Oct 16 2024 09:28:44 UTC"
(1)   Acct-Status-Type = Start
(1)   NAS-Identifier = "MikroTik"
(1)   Acct-Delay-Time = 0
(1)   NAS-IP-Address = 192.168.122.30
(1) # Executing section preacct from file
/etc/freeradius/sites-enabled/default
(1)   preacct {
(1)     [preprocess] = ok
(1)     policy acct_unique {
(1)       update request {
(1)         &Tmp-String-9 := "ai:"
(1)       } # update request = noop
(1)       if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) {
(1)       EXPAND %{hex:&Class}
(1)          -->
(1)       EXPAND ^%{hex:&Tmp-String-9}
(1)          --> ^61693a
(1)       if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) &&
("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i))  -> FALSE
(1)       else {
(1)         update request {
(1)           EXPAND
%{md5:%{User-Name},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}}
(1)              --> c8cfd558bded834454aa713d62999e75
(1)           &Acct-Unique-Session-Id := c8cfd558bded834454aa713d62999e75
(1)         } # update request = noop
(1)       } # else = noop
(1)       update request {
(1)         &Tmp-String-9 !* ANY
(1)       } # update request = noop
(1)     } # policy acct_unique = noop
(1) suffix: Checking for suffix after "@"
(1) suffix: No '@' in User-Name = "saied", looking up realm NULL
(1) suffix: No such realm "NULL"
(1)     [suffix] = noop
(1)     [files] = noop
(1)   } # preacct = ok
(1) # Executing section accounting from file
/etc/freeradius/sites-enabled/default
(1)   accounting {
(1) detail: EXPAND
/var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
(1) detail:    --> /var/log/freeradius/radacct/143.198.146.8/detail-20241016
(1) detail:
/var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
expands to /var/log/freeradius/radacct/143.198.146.8/detail-20241016
(1) detail: EXPAND %t
(1) detail:    --> Wed Oct 16 09:28:44 2024
(1)     [detail] = ok
(1)     [unix] = ok
(1) sql: EXPAND
%{tolower:type.%{%{Acct-Status-Type}:-%{Request-Processing-Stage}}.query}
(1) sql:    --> type.start.query
(1) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (1)
(1) sql: EXPAND %{User-Name}
(1) sql:    --> saied
(1) sql: SQL-User-Name set to 'saied'
(1) sql: EXPAND INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
 acctauthentic, connectinfo_start,        connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     ) VALUES
('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}',
'%{Realm}', '%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}',
'%{NAS-Port-Type}', FROM_UNIXTIME(%{%{integer:Event-Timestamp}:-%l}),
FROM_UNIXTIME(%{%{integer:Event-Timestamp}:-%l}), NULL, '0',
'%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}',
'%{Framed-Protocol}', '%{Framed-IP-Address}', '%{Framed-IPv6-Address}',
'%{Framed-IPv6-Prefix}', '%{Framed-Interface-Id}',
'%{Delegated-IPv6-Prefix}' )
(1) sql:    --> INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
 acctauthentic, connectinfo_start,        connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     ) VALUES
('81b00000', 'c8cfd558bded834454aa713d62999e75', 'saied', '',
'192.168.122.30', 'ether2', 'Ethernet', FROM_UNIXTIME(1729070924),
FROM_UNIXTIME(1729070924), NULL, '0', 'RADIUS', '', '', '0', '0', '',
'0C:DC:B7:B1:00:00', '', 'Framed-User', 'PPP', '10.10.10.254', '', '', '',
'' )
(1) sql: Executing query: INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,
 nasipaddress,           nasportid, nasporttype,         acctstarttime,
     acctupdatetime, acctstoptime,           acctsessiontime,
acctauthentic, connectinfo_start,       connectinfo_stop,
acctinputoctets, acctoutputoctets,      calledstationid,
 callingstationid, acctterminatecause,   servicetype,
 framedprotocol, framedipaddress,        framedipv6address,
 framedipv6prefix, framedinterfaceid,   delegatedipv6prefix     ) VALUES
('81b00000', 'c8cfd558bded834454aa713d62999e75', 'saied', '',
'192.168.122.30', 'ether2', 'Ethernet', FROM_UNIXTIME(1729070924),
FROM_UNIXTIME(1729070924), NULL, '0', 'RADIUS', '', '', '0', '0', '',
'0C:DC:B7:B1:00:00', '', 'Framed-User', 'PPP', '10.10.10.254', '', '', '',
'' )
(1) sql: rlm_sql_mysql: ERROR 1062 (Duplicate entry
'c8cfd558bded834454aa713d62999e75' for key 'acctuniqueid'): 23000
(1) sql: SQL query returned: need alt query
(1) sql: Trying next query...
(1) sql: EXPAND UPDATE radacct SET acctstarttime        =
FROM_UNIXTIME(%{%{integer:Event-Timestamp}:-%l}), acctupdatetime      =
FROM_UNIXTIME(%{%{integer:Event-Timestamp}:-%l}), connectinfo_start =
'%{Connect-Info}' WHERE AcctUniqueId = '%{Acct-Unique-Session-Id}'
(1) sql:    --> UPDATE radacct SET acctstarttime        =
FROM_UNIXTIME(1729070924), acctupdatetime     = FROM_UNIXTIME(1729070924),
connectinfo_start = '' WHERE AcctUniqueId =
'c8cfd558bded834454aa713d62999e75'
(1) sql: Executing query: UPDATE radacct SET acctstarttime      =
FROM_UNIXTIME(1729070924), acctupdatetime     = FROM_UNIXTIME(1729070924),
connectinfo_start = '' WHERE AcctUniqueId =
'c8cfd558bded834454aa713d62999e75'
rlm_sql_mysql: Rows matched: 1  Changed: 1  Warnings: 0
(1) sql: SQL query returned: success
(1) sql: 1 record(s) updated
rlm_sql (sql): Released connection (1)
(1)     [sql] = ok
(1)     [exec] = noop
(1) attr_filter.accounting_response: EXPAND %{User-Name}
(1) attr_filter.accounting_response:    --> saied
(1) attr_filter.accounting_response: Matched entry DEFAULT at line 12
(1)     [attr_filter.accounting_response] = updated
(1)   } # accounting = updated
(1) Sent Accounting-Response Id 92 from 67.205.156.27:1813 to
143.198.146.8:53796 length 20
(1) Finished request
(1) Cleaning up request packet ID 92 with timestamp +91 due to done
Waking up in 4.9 seconds.



Here is what sql shows when I look in the Database.
Database changed
MariaDB [radius]> select * from radacct;
+-----------+---------------+----------------------------------+----------+-------+----------------+-----------+-------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-------------------+------------------+-----------------+------------------+-----------------+-------------------+---------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+-------+
| radacctid | acctsessionid | acctuniqueid                     | username |
realm | nasipaddress   | nasportid | nasporttype | acctstarttime       |
acctupdatetime      | acctstoptime        | acctinterval | acctsessiontime
| acctauthentic | connectinfo_start | connectinfo_stop | acctinputoctets |
acctoutputoctets | calledstationid | callingstationid  | acctterminatecause
 | servicetype | framedprotocol | framedipaddress | framedipv6address |
framedipv6prefix | framedinterfaceid | delegatedipv6prefix | class |
+-----------+---------------+----------------------------------+----------+-------+----------------+-----------+-------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-------------------+------------------+-----------------+------------------+-----------------+-------------------+---------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+-------+
|         1 | 81b00001      | c5b520f5f99234b6ed61f3b91a217a49 | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 09:34:03 |
2024-10-16 12:01:17 | 2024-10-16 12:01:17 |         NULL |            8834
| RADIUS        |                   |                  |           19722 |
              38 |                 | 0C:DC:B7:B1:00:00 | NAS-Request
  | Framed-User | PPP            | 10.10.10.254    |                   |
               |                   |                     | NULL  |
|         2 | 81b00002      | a36501de59fc00c13cfe1a011de4fd1c | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:01:17 |
2024-10-16 12:01:17 | 2024-10-16 12:02:16 |         NULL |              59
|               |                   |                  |             304 |
              38 |                 | 0C:DC:B7:B1:00:00 | NAS-Request
  | Framed-User | NULL           |                 |                   |
               |                   |                     | NULL  |
|         4 | 81b00003      | b7c690ca4602a8df92e3c1d2472eedea | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:02:16 |
2024-10-16 12:02:16 | 2024-10-16 12:02:16 |         NULL |               0
|               |                   | NULL             |               0 |
               0 |                 | 0C:DC:B7:B1:00:00 | Clear-Stale
Session | Framed-User | NULL           |                 |
  |                  |                   |                     | NULL  |
|         6 | 81b00008      | eb0f29a1415fe5bdfa7acbcb7b4101c5 | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:04:12 |
2024-10-16 12:04:12 | 2024-10-16 12:05:29 |         NULL |              77
|               |                   |                  |             304 |
              38 |                 | 0C:DC:B7:B1:00:00 | User-Request
 | Framed-User | NULL           |                 |                   |
             |                   |                     | NULL  |
|         8 | 81b00009      | 14647eb912c0c8314f7061cfae10bb30 | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:05:30 |
2024-10-16 12:05:30 | 2024-10-16 12:10:34 |         NULL |             305
|               |                   |                  |             836 |
              38 | service1        | 0C:DC:B7:B1:00:00 | User-Request
 | Framed-User | NULL           |                 |                   |
             |                   |                     | NULL  |
|        10 | 81b0000a      | 6e08adb4e8f5983f43c6bd20e3df5009 | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:10:46 |
2024-10-16 12:10:46 | 2024-10-16 12:11:20 |         NULL |              34
|               |                   |                  |             304 |
              38 | service1        | 0C:DC:B7:B1:00:00 | NAS-Request
  | Framed-User | NULL           |                 |                   |
               |                   |                     | NULL  |
|        12 | 81b0000b      | 7499c503b3b2bc4c69f3dec28fe60f86 | saied    |
      | 192.168.122.30 | ether2    | Ethernet    | 2024-10-16 12:11:20 |
2024-10-16 12:11:20 | NULL                |         NULL |               0
|               |                   | NULL             |               0 |
               0 | service1        | 0C:DC:B7:B1:00:00 |
  | Framed-User | NULL           |                 |                   |
               |                   |                     | NULL  |
+-----------+---------------+----------------------------------+----------+-------+----------------+-----------+-------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-------------------+------------------+-----------------+------------------+-----------------+-------------------+---------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+-------+


More information about the Freeradius-Users mailing list