Summary of what I did for the Limit by Octets module. ( Softcap )
1.) Add this to the freeradius dictionary file:
$INCLUDE dictionary.chillispot
/etc/freeradius/dictionary and copy the dictionary file in this directory:
2.) Define the module (in radius.conf)
sqlcounter volumelimitcounter {
counter-name = Total-Max-Octets
check-name = Max-Octets
reply-name = ChilliSpot-Max-Total-Octets
sqlmod-inst = sql
key = User-Name
reset = never
error-msg = “Sorry, your bandwidth has exceed the provided limit”
query = “SELECT SUM(AcctOutputOctets+AcctInputOctets) FROM radacct where UserName=’%{%k}’”
}
3.) Include the volumelimitcounter module into authorize section (in radius.conf)
authorize {
# See “Authorization Queries” in sql.conf
sql
noresetcounter
volumelimitcounter
}
4.) Add the the following attributes to the freeradius-dialupadmin ( user_edit.attrs ) file:
/etc/freeradius-dialupadmin/user_edit.attrs
Max-Octets Max-Octets
ChilliSpot-Max-Total-Octets ChilliSpot-Max-Total-Octets
5.) Add checkitem to sql.attrmap in ( sql.attrmap ) file:
/etc/freeradius-dialupadmin/sql.attrmap
checkItem Max-Octets Max-Octets
6.) Add replyitem to sql.attrmap in ( /etc/freeradius-dialupadmin/sql.attrmap ) file:
replyItem ChilliSpot-Max-Total-Octets ChilliSpot-Max-Total-Octets
7.) Define the volume limit in freeradius-dialupadmin:
Do this by adding the limit through dialupadmin web interface:
Max-Octets := xxxxxx in bytes
8.) Define the volume limit in freeradius-dialupadmin:
Do this by adding the limit through dialupadmin web interface:
ChilliSpot-Max-Total-Octets := xxxxxxx in bytes
This is a soft cap, so it will only authorize the capping on logon request.
Remember to include “$PORTAL_MESSAGE$”Authentication error page.
The initial testing seem to work with m0n0wall, please feel free to comment / add to this.
Have Fun.
Satlizard

Recent Comments