Logging of DHCP queries/responses
Hernán Freschi
hjf at hjf.com.ar
Mon Oct 5 01:54:04 CEST 2015
Thanks.
This is what I ended up using:
if ("%{sql:INSERT INTO raddhcplog (date, username, mac, ip) VALUES (NOW(),
'%{User-Name}', upper(replace('%{DHCP-Client-Hardware-Address}',':','-')),
'%{reply:DHCP-Your-IP-Address}')}") {
# insert succeeded
ok
}
On Sun, Oct 4, 2015 at 12:45 PM, Alan DeKok <aland at deployingradius.com>
wrote:
> On Oct 4, 2015, at 10:55 AM, Hernán Freschi <hjf at hjf.com.ar> wrote:
> >
> > Is there a way to log DHCP queries? I would like to keep a log of
> > timestamp, MAC address and assigned IP address for every request.
>
> You can just write the SQL insert statement directly in "unlang", with a
> bit of text to wrap it:
>
>
> ...
> if ("%{sql:INSERT ....}") {
> # insert succeeded
> }
>
> ...
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list