Use of %{Framed-IP-Address} in dialup.conf
I'm logging into MySQL via post_auth_query = SQL query. I've added some fields that I want to log, such as the allocated IP address, the NAS IP address and the Calling-Station-ID. All fields are logging fine except for Framed-IP-Address which just seems to be absent. Is that variable not supposed to be accessible at that point? Here's an example entry from radreply, showing that I am indeed using Framed-IP-Address: +-----+---------------------+-------------------+----+--------------+ | id | username | attribute | op | value | +-----+---------------------+-------------------+----+--------------+ | 1 | username@host.com | Framed-IP-Address | := | 10.10.10.10 | Here's what I have in dialup.conf: postauth_query = "INSERT INTO ${postauth_table} \ (username, pass, reply, response, nas, location, authdate) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', \ '%{Framed-IP-Address}', \ '%{NAS-IP-Address}', \ '%{Calling-Station-ID}', '%S')" Is there anything obvious that I'm missing? Any suggestions on where to look for problems? Best regards, Örn
Örn Arnarson wrote:
I'm logging into MySQL via post_auth_query = SQL query.
I've added some fields that I want to log, such as the allocated IP address, the NAS IP address and the Calling-Station-ID.
All fields are logging fine except for Framed-IP-Address which just seems to be absent. Is that variable not supposed to be accessible at that point?
If it's in the packet. If it's not in the packet, it doesn't exist, and the server can't use it. Alan DeKok.
Hi Alan, There is a Framed-IP-Address: xxx.xx.xx.xxx in the packet. That should then presumably mean that I should be able to access this variable in said config file? Regards, Örn On Mon, Jan 14, 2013 at 2:07 AM, Alan DeKok <aland@deployingradius.com>wrote:
Örn Arnarson wrote:
I'm logging into MySQL via post_auth_query = SQL query.
I've added some fields that I want to log, such as the allocated IP address, the NAS IP address and the Calling-Station-ID.
All fields are logging fine except for Framed-IP-Address which just seems to be absent. Is that variable not supposed to be accessible at that point?
If it's in the packet.
If it's not in the packet, it doesn't exist, and the server can't use it.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Örn Arnarson wrote:
Hi Alan,
There is a Framed-IP-Address: xxx.xx.xx.xxx in the packet. That should then presumably mean that I should be able to access this variable in said config file?
Yes. Run the server in debugging mode to see. Odds are the Framed-IP-Address is in the Access-Request, but not in any subsequent Accounting-Request. That would be the problem. Alan DeKok.
On 15 Jan 2013, at 21:02, Alan DeKok <aland@deployingradius.com> wrote:
Örn Arnarson wrote:
Hi Alan,
There is a Framed-IP-Address: xxx.xx.xx.xxx in the packet.
Outbound packet right (reply)? Because you're dealing with an Access-Request, which is why you're modifying the Post-Auth query?
That should then presumably mean that I should be able to access this variable in said config file?
Yes. Run the server in debugging mode to see.
Odds are the Framed-IP-Address is in the Access-Request, but not in any subsequent Accounting-Request. That would be the problem.
Accounting-Requests don't go through Post-Auth, see OP's first message, he's wanting to log the IP he assigned, else he's being an idiot and including irrelevant snippets of config. OP Use %{reply:Framed-IP-Address} in your postauth_query. -Arran
Arran, Thanks very much. That was exactly what I was looking for, and it works like a charm. I understand how radius works a little better now as well. Thanks to Alan as well. Regards, Örn On Tue, Jan 15, 2013 at 9:56 PM, Arran Cudbard-Bell < a.cudbardb@freeradius.org> wrote:
On 15 Jan 2013, at 21:02, Alan DeKok <aland@deployingradius.com> wrote:
Örn Arnarson wrote:
Hi Alan,
There is a Framed-IP-Address: xxx.xx.xx.xxx in the packet.
Outbound packet right (reply)? Because you're dealing with an Access-Request, which is why you're modifying the Post-Auth query?
That should then presumably mean that I should be able to access this variable in said config file?
Yes. Run the server in debugging mode to see.
Odds are the Framed-IP-Address is in the Access-Request, but not in any subsequent Accounting-Request. That would be the problem.
Accounting-Requests don't go through Post-Auth, see OP's first message, he's wanting to log the IP he assigned, else he's being an idiot and including irrelevant snippets of config.
OP Use %{reply:Framed-IP-Address} in your postauth_query.
-Arran - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Arran Cudbard-Bell -
Örn Arnarson