assign a value to an attribute via a script
Hello, I'm searching how to use a script to modify the value of an attribute. When I try the example of radiusd.conf : Attribute-Name = `%{echo:/path/to/program args}` In my test I try to use a script to assign an IP address to the Attribute Framed-IP-Address : Framed-IP-Address = `%{dhcp:/etc/raddb/test %{User-Name} %{NAS-IP-Address}}` I've added this in the accounting module with the same result as I want to fic this value in the attribute Framed-IP-Address during the time of an active accounting session. I've created an exec module : exec dhcp { wait = yes input_pairs = request output_pairs = reply packet_type = Access-Accept } I get an error message when I try to start : ERROR: Cannot find a configuration entry for module "Framed-IP-Address". The rest of the radiusd.conf configuration is pointing to a MySQL database and works well. I've tested successfully the script itself alone in the echo module configuration : program = "/var/log/radius/test %{User-Name} %{NAS-IP-Address}" What am I doing wrong ? Is something missing ? Sincerely, Philippe BACQUAERT Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn)
"Philippe Bacquaert" <philippe.bacquaert@laposte.net> wrote:
I'm searching how to use a script to modify the value of an attribute.
See scripts/exec-program-wait for an example.
In my test I try to use a script to assign an IP address to the Attribute Framed-IP-Address : Framed-IP-Address = `%{dhcp:/etc/raddb/test %{User-Name} %{NAS-IP-Address}}`
Is that an entry in the "users" file?
I get an error message when I try to start : ERROR: Cannot find a configuration entry for module "Framed-IP-Address".
Ah. You put the attribute in radiusd.conf. Why? The documentation didn't say to do that, and all of the other examples of setting attributes put them in other files, like the "users" file. Alan DeKok.
----- Original Message ----- From: "Philippe Bacquaert" <philippe.bacquaert@laposte.net> To: "freeradius-users" <freeradius-users@lists.freeradius.org> Sent: Wednesday, April 26, 2006 10:46 AM Subject: assign a value to an attribute via a script
Hello,
I'm searching how to use a script to modify the value of an attribute.
When I try the example of radiusd.conf : Attribute-Name = `%{echo:/path/to/program args}`
In my test I try to use a script to assign an IP address to the Attribute Framed-IP-Address : Framed-IP-Address = `%{dhcp:/etc/raddb/test %{User-Name} %{NAS-IP-Address}}`
I've added this in the accounting module with the same result as I want to fic this value in the attribute Framed-IP-Address during the time of an active accounting session.
I've created an exec module : exec dhcp { wait = yes input_pairs = request output_pairs = reply packet_type = Access-Accept }
I get an error message when I try to start : ERROR: Cannot find a configuration entry for module "Framed-IP-Address".
The rest of the radiusd.conf configuration is pointing to a MySQL database and works well.
I've tested successfully the script itself alone in the echo module configuration : program = "/var/log/radius/test %{User-Name} %{NAS-IP-Address}"
What am I doing wrong ? Is something missing ?
Sincerely, Philippe BACQUAERT
If you want to assign fixed ip address to a user add FramedIPAddress field into radreply table for that user?
participants (3)
-
Alan DeKok -
Igor Smitran -
Philippe Bacquaert