News: This forum is now permanently frozen.
Pages: [1]
Topic: Softcap with Freeradius  (Read 4739 times)
« on: June 23, 2007, 18:42:08 »
satlizard26 *
Posts: 26

After my first post on this I had no replies, but I eventually got his working.

Here it is:

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

« Reply #1 on: August 11, 2008, 16:25:43 »
smitajadhav83 *
Posts: 3

Hello,

Can you please let me know, how did you handle this in m0n0wall? Did you made any changes in m0n0wall and which m0n0wall version you used?


 Smiley
« Reply #2 on: August 14, 2008, 21:47:21 »
satlizard26 *
Posts: 26

Hi

Sure no problem. no changes to m0n0wall. The Key here is the version of Freeradius.

Compiled Freeradius 1.1.6 from Source, added the settings as this previous post.

Only problem is the there is a 3Gig limit on Softcap, works for me.

Also take a look at Hotcakes and EasyHotspot, got it working, but I stuck to my custom setup with dialupadmin and m0n0 captive portal.

Regards,

Satlizard
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines