RADIUS + MySQL + decisionmaking?
Jan Mulders
lastchancehotel at gmail.com
Wed Sep 27 03:47:07 CEST 2006
Hello,
I am trying to set up some decision-making logic into FreeRADIUS, to
assign users a different speed of service depending on how much
bandwidth they've used since their billing started.
I want to issue 512k speed to users in group A, who have used less
than 20GB of bandwidth (monthlybytecounter is working fine at the
moment and totals this up nicely). However, if they've used more than
20GB, I want to issue 256k speed to users.
For group B, I want users to get 10Mbps as long as they've used less
than 50GB of bandwidth, and 1Mbps if they're over.
I want to assign the values for speed to some vendor-specific
variable, let's say Max-User-Speed.
I am using MySQL for this. Here is a snippet from my database:
radcheck table:
username, attribute, op, value
testuser1, Password, ==, testing
usergroup table:
username, groupname
testuser1, groupa
Here is a snippet from my radiusd.conf file:
instantiate {
monthlybytecounter
}
authorize {
preprocess
sql
}
authenticate {
pap
}
preacct {
preprocess
}
accounting {
#acct_unique
#detail
sql
radutmp # ?
}
session {
radutmp # ?
sql
}
My question is... how do I implement this? Can anyone write down a few
examples of how I'd go about making these rules?
Would I perhaps be better off making a cronjob or something that
changes the user's group to one of the following? groupA_belowcap,
groupA_overcap, groupB_belowcap, groupB_overcap?
Regards,
Jan Mulders
More information about the Freeradius-Users
mailing list