problem with IP 127.0.0.1

2005-04-06 Thread Marek Bartnikowski
hello,
I have freeradius configured to use postgresql database.

in sql.conf I have

authorize_check_query = "SELECT id,UserName,Attribute,Value,op,
FROM ${authcheck_table} WHERE Username = '%{SQL-User-Name}' and 
ip='%{NAS-IP-Address}' 
ORDER BY id"

I have Motorola wifi Cable modem SBG900.
I try to authenticate username and password withh freeradius.
anything was all right, when i didnt use NAS-IP-Address. but, I have
to use ip address from my database, to check if username can appear
behind ip.
so, when I looking to postgresl log, I see:

SELECT id,UserName,Attribute,Value,op, ip FROM v_wifi_auth WHERE
Username = 'john'  and ip='10.23.31.101' ORDER BY id ;

and this is ok. user john, has cable modem which IP is 10.23.31.101.

BUT!

in next lines I see query like that:

SELECT id,UserName,Attribute,Value,op, ip FROM v_wifi_auth WHERE
Username = 'john'  and ip='127.0.0.1' ORDER BY id ;
   ^

of course there is no modem with that address. 
server logs says:

 Processing the authorize section of radiusd.conf
modcall: entering group authorize for request 5
  modcall[authorize]: module "preprocess" returns ok for request 5
rlm_checkval: Item Name: NAS-IP-Address, Value: 127.0.0.1
rlm_checkval: Could not find attribute named Calling-Station-Id in
check pairs
  modcall[authorize]: module "checkval" returns notfound for request 5
.

i was looking googole to solve my problem, but I didt find answer.

so, I'm asking for help.
I don't want 127.0.0.1 in my db queries.
where can I 'disable' asking for ip 127.0.0.1?

please, help.
thanks

-- 
Marek Bartnikowski
"All mail clients suck. This one just sucks less."

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: problem with IP 127.0.0.1

2005-04-06 Thread Marek Bartnikowski

: > SELECT id,UserName,Attribute,Value,op, ip FROM v_wifi_auth WHERE
: > Username = 'john'  and ip='127.0.0.1' ORDER BY id ;
: 
:   Yes.  The NAS-IP-Address is put into the RADIUS packet by the NAS,
: and it can have ANY value.
: 
: > I don't want 127.0.0.1 in my db queries.
: > where can I 'disable' asking for ip 127.0.0.1?
: 
:   You can't.  It's the value of NAS-IP-Address.  If you look at the
: debug log, you will see that the NAS is sending that value to the
: server.
: 
:   The solution is to NOT use NAS-IP-Address, but Client-IP-Address.
: It's the IP address that the packet came from, and it's generated by
: FreeRADIUS, so you know it's correct.

helo again.
when I changed NAS-IP-Address to Client-IP-Address I still have the
SAME problem. I see first valid IP addres and next 127.0.0.1
any sugestions?

thanks.

-- 
Marek Bartnikowski
"All mail clients suck. This one just sucks less."

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html