0

I've added this block to radiusd.conf

sqlcounter monthlytrafficcounter {
    vcounter-name = Monthly-Traffic
    check-name = Max-Monthly-Traffic
    reply-name = Monthly-Traffic-LIMIT
    sqlmod-inst = SQL
    key = User-Name
    reset = monthly
    query = "SELECT SUM(acctinputoctets + acctoutputoctets) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) > '%b'"
}

and added the ditrctionary

ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer

then added monthlytrafficcounter to authorize in /etc/freeradius/sites-enabled/default

but it doesn't work

The Max-Monthly-Traffic is defined in MySQL table radgroupcheck and the users has added to the group in radusergroup

Although a user has reached the traffic limit, he still can be authorized by FreeRadius: https://i.stack.imgur.com/RIVsZ.jpg

Balthild Ires
  • 31
  • 2
  • 5

1 Answers1

0

Try moving your radiusd.conf block to sql/mysql/counter.conf

teo van kot
  • 12,350
  • 10
  • 38
  • 70
Dineshh Bhardwaj
  • 75
  • 1
  • 3
  • 13