Using MySQL and assigning IP-Addresses based onCalling-Station-ID

Phil Mayers p.mayers at imperial.ac.uk
Mon Jan 15 19:27:49 CET 2007


Ackbar Joolia wrote:
> Phil, Thanks for your reply. I didn’t know about the Fall-Through.
> 
> I have got a list of static addresses, which I will need to assign
> through the Framed-IP-Address attribute.
> 
> This is what I am trying to do: When I receive requests, they all
> come with the same username and password, but with different
> Calling-Station-ID. I have to authenticate and differentiate on the
> calling-station-id, and then assign static IP-Address to these users,
> based on the calling-station-id.

Ah.

> 
> I know it sounds simple, but I can't get it to work or am not getting
> the logic right. Can you advise please?

You won't be able to do that on the current SQL code. Since the SQL 
groups are all "squashed together" and you're using the same user.

> 
> My model has to work in the way described above i.e. same username
> and password, and assigning Framed-IP-Address based on the
> calling-station-id, in MySql.

You could try the CVS code - it should work as you expect. Set the 
user-password on the "radcheck" table, then have a group per station 
with a single check item of calling-station-id, and a single reply item 
of framed-ip-address

If you can't upgrade, you could possibly re-write the username to the 
calling-station-id in the hints file, then put the calling-station-id as 
the username in radcheck, and the framed-ip-address in radreply.

I know you said it "has to" be in mysql, but you should also investigate 
the rlm_passwd module (which does not do what it sounds like). It ought 
to be trivial to dump the SQL to a file of the form:

calling-station-id:framed-ip-address

...and set it on the reply. See "man rlm_passwd"



More information about the Freeradius-Users mailing list