Using DHCP

Fajar A. Nugraha list at fajar.net
Tue Mar 13 12:41:06 CET 2012


On Tue, Mar 13, 2012 at 6:32 PM, Franz <flamana at gmail.com> wrote:
> Thank you Fajar, I am using mysql, i will play arround with the queries.

I might not be clear-enough in my last reply.

You should NOT need to alter any existing queries. Instead, you need
to ADD new queries in ldap virtual server to get the user group.
Something like

update control {
     Sql-Group = "%{SELECT groupname FROM radusergroup where ...}"
}

if ( Sql-Group == "my-special-group" ) {
     update reply {
         DHCP-IP-Address-Lease-Time := 60
     }
}


Now the above is just an example, which won't work, since the query is
a dummy one. I'm not sure what kind of group checking you can do in
LDAP. Do you group them based on MAC address, for example?

Anyway, if you can define the policy, how to group them, then the
above can be a good start.

-- 
Fajar

>
> Thanks,
>
> Franz
>
> On Mar 12, 2012, at 5:08 PM, "Fajar A. Nugraha" <list at fajar.net> wrote:
>
>> On Mon, Mar 12, 2012 at 10:25 PM, Franz <flamana at gmail.com> wrote:
>>> Hi,
>>> I was wondering if when using DHCP with freeradius we can control the
>>> lease time depending on the group the user belongs to.
>>
>> Possible, but you need to create the rule yourself.
>>
>> If you use v2.1.x branch from git, the lease time is selected by
>> default in the config file. If you're using sql or ldap to store your
>> users, you can easily change it with unlang.
>>
>> --
>> Fajar
>> -
>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list