Dear All, I need your help to configure FreeRadius to rewrite the User-Name attribute in Accounting-Request. my setup as follow; please correct me if i had a mistake, i'm using Freeradius to do a proxy to another radius server. we are using one username (wanadoo) as a default username for our prepaid card system. in the freeradius server we replace the username with a new one which is the same as the password, so we are using pre-proxy to call attr_rewrite that will replace the username with the new one. As an authintecation process every thing goes will, but for the Accounting the free radius didnt change the username and send it as it is to the another radius which mean that i couldnt do accounting for them. so could you please help me to solve like this problem. attr_rewrite fixusername { attribute = User-Name searchin = proxy searchfor ="wanadoo" replacewith = %{Password} ignore_case = no new_attribute = no max_matches = 10 append = no } pre-proxy { fixusername pre_proxy_log } This is what i found in the log file, Packet-Type = Access-Request Wed Jan 31 07:55:27 2007 User-Name = "11111111114242" User-Password = "11111111114242" NAS-IP-Address = 172.16.5.188 Client-IP-Address = 172.16.5.188 Stripped-User-Name = "wanadoo" Realm = "coolnet" Realm = "coolnet" Proxy-State = 0x3833 Packet-Type = Accounting-Request Wed Jan 31 07:55:27 2007 Acct-Session-Id = "76" Acct-Status-Type = Start User-Name = "wanadoo" NAS-Port = 2 Service-Type = Framed-User Framed-Protocol = PPP Framed-IP-Address = 255.255.255.254 Class = 0x5376633d32 NAS-IP-Address = 172.16.5.188 Client-IP-Address = 172.16.5.188 Acct-Unique-Session-Id = "26331f725bfc7b96" Stripped-User-Name = "wanadoo" Realm = "coolnet" Realm = "coolnet" Proxy-State = 0x3834
Ashraf Al-Basti wrote: ...
in the freeradius server we replace the username with a new one which is the same as the password, so we are using pre-proxy to call attr_rewrite that will replace the username with the new one. As an authintecation process every thing goes will, but for the Accounting the free radius didnt change the username and send it as it is to the another radius which mean that i couldnt do accounting for them. so could you please help me to solve like this problem. ... This is what i found in the log file,
Why? Why aren't you running the server in debugging mode as suggested in the README, FAQ, INSTALL, and daily on this list? In any case, your post already contains the answer to your question: There's no "Password" attribute in accounting requests. The log files you posted show this clearly. Read them. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Thanks Alan...... But do have any idea to work around that? Alan DeKok wrote:
Ashraf Al-Basti wrote: ...
in the freeradius server we replace the username with a new one which is the same as the password, so we are using pre-proxy to call attr_rewrite that will replace the username with the new one. As an authintecation process every thing goes will, but for the Accounting the free radius didnt change the username and send it as it is to the another radius which mean that i couldnt do accounting for them. so could you please help me to solve like this problem.
...
This is what i found in the log file,
Why? Why aren't you running the server in debugging mode as suggested in the README, FAQ, INSTALL, and daily on this list?
In any case, your post already contains the answer to your question: There's no "Password" attribute in accounting requests. The log files you posted show this clearly. Read them.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Ashraf Al-Basti wrote:
Thanks Alan...... But do have any idea to work around that?
See the FAQ. If the NAS doesn't send data in an accounting packet, go read the NAS documentation to see how to configure it to send that information. But send User-Password? Nope. It's impossible. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
i change the process as follow to replace the username with a one from a file but i have the following error, attr_rewrite fixusername { attribute = User-Name # may be "packet", "reply", "proxy", "proxy_reply" or "config" searchin = proxy searchfor ="wanadoo" replacewith = %{exec:/bin/cat /var/www/html/user} ignore_case = no new_attribute = no max_matches = 10 # ## If set to yes then the replace string will be appended to the original string # append = no } error radius_xlat: 'wanadoo' WARNING: Attempt to use unknown xlat function, or non-existent attribute in string %{exec:/bin/cat} radius_xlat: '' rlm_attr_rewrite: xlat on replace string failed. Alan DeKok wrote:
Ashraf Al-Basti wrote:
Thanks Alan...... But do have any idea to work around that?
See the FAQ. If the NAS doesn't send data in an accounting packet, go read the NAS documentation to see how to configure it to send that information.
But send User-Password? Nope. It's impossible.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Dear All, Anyone can help how to rewrite the password attribute, i want to replace the password with a new one from a file. i'm trying to use the "echo" but it didnt work.... Ashraf Al-Basti wrote:
i change the process as follow to replace the username with a one from a file but i have the following error, attr_rewrite fixusername { attribute = User-Name # may be "packet", "reply", "proxy", "proxy_reply" or "config" searchin = proxy searchfor ="wanadoo" replacewith = %{exec:/bin/cat /var/www/html/user} ignore_case = no new_attribute = no max_matches = 10 # ## If set to yes then the replace string will be appended to the original string # append = no }
error radius_xlat: 'wanadoo' WARNING: Attempt to use unknown xlat function, or non-existent attribute in string %{exec:/bin/cat} radius_xlat: '' rlm_attr_rewrite: xlat on replace string failed.
Alan DeKok wrote:
Ashraf Al-Basti wrote:
Thanks Alan...... But do have any idea to work around that?
See the FAQ. If the NAS doesn't send data in an accounting packet, go read the NAS documentation to see how to configure it to send that information.
But send User-Password? Nope. It's impossible.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
Ashraf Al-Basti