Custom sql post-auth help

Trey Briggs tbriggs at api-digital.com
Mon Apr 4 21:34:47 CEST 2011


Hi,

I'm trying to get similar logging in mysql to what you see with:

log {
  ...
  auth = yes
  auth_badpass = yes
  auth_goodpass = yes
}

"Login OK: [<user>/<pass>] (from client <client> port 0)"

I've found how to log accepts and rejects using the sql module in the
post-auth section, but I'm unsure how to insert the client info (name or IP
is fine).

Here's what I've tried:

sql/mysql/dialup.conf
        postauth_query = "INSERT INTO ${postauth_table} \
                          (username, pass, reply, authdate, nas_ip, nas_id)
\
                          VALUES ( \
                          '%{User-Name}', \
                          '%{%{User-Password}:-%{Chap-Password}}', \
                          '%{NAS-Identifier}', \
                          '%{reply:Packet-Type}', '%S', \
                          '%{NAS-IP-Address}')"

It doesn't appear that the "NAS-IP-Address" has any data at this point in
the chain, the debug output shows this as the query run:

rlm_sql (sql) in sql_postauth: query is INSERT INTO
radpostauth                           (username, pass, nas_id, reply,
authdate, nas_ip) VALUES ( 'XXXXX', 'xxxx', 'YYYYY', 'Access-Accept',
'2011-04-04 13:56:33', '')

Is there another variable I can use to get the client name/ip inserted into
the db? Is this even possible in post-auth?

Thanks in advance,

-- 
Trey Briggs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110404/f73c6bca/attachment.html>


More information about the Freeradius-Users mailing list