Disconnect user when hit bandwith

Dinesh Bhardwaj dinesh at airjaldi.net
Fri Aug 26 20:20:17 CEST 2016


So you mean your counter does not work?
What happens when user has used 1Gb and tries to connect?

On Fri, Aug 26, 2016 at 11:40 PM, Mohamad Yazdian <m.programer at gmail.com>
wrote:

> Hello
> I use freeradius for authenticate my PPPoE users and I NAS router is
> mikrotik.
> every think is fine like as authentication and expiration in the monthly
> date but now I like to limit my users for 1G downloadn per month but when I
> make a sqlcounter and add this counter to the site-available default
> (authorize{}).
>
> I use the Mikrotik-Total-Limit in my sqlcounter and add this counter name
> on the radcheck table for my users so when my users hit the 1G bandwith (1
> week etc.) the connections are not droped...!!!
> But when the users disconnect the pppoe connection and try again to connect
> get the access denied message.
>
> I like to dissconnect the pppoe connection when hit 1G.
>
> Please advise me how to solve this issue.
>
> Thank you
>
> sqlcounter  sample_Limit{
> counter-name = Mikrotik-Total-Limit
>                 check-name = Mikrotik-Total-Limit
>                 reply-name = Mikrotik-Total-Limit
>                 sqlmod-inst = sql
>                 key = User-Name
>                 reset = never
>                 query = "SELECT
> ((SUM(AcctInputOctets)+SUM(AcctOutputOctets))) FROM radacct WHERE
> UserName='%{%k}'"
> }
>
>
> sample_Limit{
> reject = 1
> }
> if(reject){
> update reply {
> Reply-Message := "You have reached your bandwidth limit"
> }
> reject
> }
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html




-- 
Dinesh Bhardwaj
Chief Technology Officer
Rural Broadband Pvt. Ltd.
www.airjaldi.com
Tel. (91) 985-757-0709
Skype: dineshbhardwaj


More information about the Freeradius-Users mailing list