Modifying accounting request with vendor-specific attribute
Alan DeKok
aland at deployingradius.com
Wed Jan 17 20:24:47 UTC 2024
On Jan 17, 2024, at 2:54 PM, Kruz Gaffaney <GaffaneyK at rconnects.net> wrote:
>
> Hello, I’m attempting to use unlang to modify the accounting request packets. My intent is to add the “Calling-Station-Id” attribute to the requests with the value of a vendor-specific attribute before the packet gets replicated to my home servers. I’ve created a custom policy to update the “Calling-Station-Id” attribute but I seem to be getting errors when running radius in debugging mode. I need to update that attribute with the value of a vendor-specific attribute that my NAS is sending to the radius server. I’ve been looking through the documentation and I can’t seem to find how to properly reference a vendor-specific attribute in a update policy.
Just reference it by name. The debug output shows the name.
> Please see the custom policy and debugging output below.
>
> Custom policy in /etc/raddb/policy.d/canonicalization
>
> custom_rewrite_calling_station_id {
> update request {
> Calling-Station-Id = "%{request:Vendor-Specific:client-mac-address}"
That does not match the documentation or the examples in the configuration.
If you want to copy an attribute:
a) read the debug output to see the attribute name
b) use that attribute name in an "update" section.
> /etc/raddb/policy.d/canonicalization[116]: Failed parsing expanded string:
> /etc/raddb/policy.d/canonicalization[116]: %{request:Vendor-Specific:client-mac-address}
> /etc/raddb/policy.d/canonicalization[116]: ^ Attribute 'Vendor-Specific' cannot have a tag
That uses the wrong syntax.
Instead, use something like:
update request {
Calling-Station-Id := &request:Cisco-AVPair
}
That's it. Just replace "Cisco-AVPair" with whatever attribute name shows up in debug output.
Alan DeKok.
More information about the Freeradius-Users
mailing list