Time for action – limiting a user's usage
The following sections will demonstrate how to limit Internet usage.
Activating a daily counter
The counter
module has the following counter defined by default:
counter daily {
filename = ${db_dir}/db.daily
key = User-Name
count-attribute = Acct-Session-Time
reset = daily
counter-name = Daily-Session-Time
check-name = Max-Daily-Session
reply-name = Session-Timeout
allowed-servicetype = Framed-User
cache-size = 5000
}
Modify the counter as follows:
- Edit the
sites-enabled/default
file in the FreeRADIUS configuration directory. Uncommentdaily
in both theauthorize
andaccounting
sections. Also, uncommentdaily
in theinstantiate
section of theradius.conf
file to ensure proper instantiation of the counter. - The AVPs
Max-Daily-Session
andDaily-Session-Time
are not listed in any dictionary. Edit thedictionary
file in the FreeRADIUS configuration directory and add them:#ATTRIBUTE My-Local-String ...