Data limit

Randeep randeep123 at gmail.com
Fri Jul 3 11:57:08 CEST 2015


Hi,

We are configuring FreeRadius with Mikrotik router. All the expected things
are working but the maximum data usage allowed for a user is showing some
issues.

mysql> select * from radusergroup;
+-----------+-----------+----------+
| username  | groupname | priority |
+-----------+-----------+----------+
*| lukup     | testing   |        1 |*


mysql> select * from radgroupcheck;
+----+---------------------------+---------------------+----+--------------+
| id | groupname                 | attribute           | op | value        |
+----+---------------------------+---------------------+----+--------------+
|  1 | daloRADIUS-Disabled-Users | Auth-Type           | := | Reject       |
| 25 | testing                   | Mikrotik-Rate-Limit | := | 1024k/1024k  |

*| 26 | testing                   | Max-Data            | := | 5368709120
|*


But its not taking the Max-Data value as defined. Its taking maximum 4GB.


Fri Jul  3 14:20:31 2015 : Info: [acct_unique] Hashing 'NAS-Port =
2162163720,NAS-Identifier = "MikroTik",NAS-IP-Address =
192.168.1.1,Acct-Session-Id = "80e00008",User-Name = "lukup"'

Fri Jul  3 14:20:31 2015 : Info: [sql]  expand: %{User-Name} -> lukup
Fri Jul  3 14:20:31 2015 : Info: [sql] sql_set_user escaped user --> 'lukup'
Fri Jul  3 14:20:31 2015 : Info: [sql]  expand: %{Acct-Input-Gigawords} -> 0
Fri Jul  3 14:20:31 2015 : Info: [sql]  expand: %{Acct-Input-Octets} ->
397958
Fri Jul  3 14:20:31 2015 : Info: [sql]  expand: %{Acct-Output-Gigawords} ->
0
Fri Jul  3 14:20:31 2015 : Info: [sql]  expand: %{Acct-Output-Octets} ->
10134336
Fri Jul  3 14:20:31 2015 : Info: [sql]  expand:            UPDATE radacct
        SET              framedipaddress = '%{Framed-IP-Address}',
     acctsessiontime     = '%{Acct-Session-Time}',
 acctinputoctets     = '%{%{Acct-Input-Gigawords}:-0}'  << 32 |
                       '%{%{Acct-Input-Octets}:-0}',
 acctoutputoctets    = '%{%{Acct-Output-Gigawords}:-0}' << 32 |
                       '%{%{Acct-Output-Octets}:-0}'           WHERE
acctsessionid = '%{Acct-Session-Id}'           AND username        =
'%{SQL-User-Name}'           AND nasipaddress    = '%{NAS-IP-Address}' ->
         UPDATE radacct           SET              framedipaddress =
'192.168.1.178',              acctsessiontime     = '61',
 acctinputoctets     = '0'  << 32 |
 '397958',              acctoutputoctets    = '0' << 32 |
                 '10134336'           WHERE acctsessionid = '80e00008'
      AND username        = 'lukup'           AND n
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Reserving sql socket id: 0
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Released sql socket id: 0
Fri Jul  3 14:20:31 2015 : Info: ++[sql] = ok
Fri Jul  3 14:20:31 2015 : Info: ++update control {
Fri Jul  3 14:20:31 2015 : Info: sql_xlat
Fri Jul  3 14:20:31 2015 : Info:        expand: %{User-Name} -> lukup
Fri Jul  3 14:20:31 2015 : Info: sql_set_user escaped user --> 'lukup'
Fri Jul  3 14:20:31 2015 : Info:        expand: SELECT
(SUM(acctinputoctets)+SUM(acctoutputoctets)) AS Total FROM radacct where
radacct.username='%{User-Name}' -> SELECT
(SUM(acctinputoctets)+SUM(acctoutputoctets)) AS Total FROM radacct where
radacct.username='lukup'
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Reserving sql socket id: 4
Fri Jul  3 14:20:31 2015 : Info: sql_xlat finished
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Released sql socket id: 4
Fri Jul  3 14:20:31 2015 : Info:        expand: %{sql:SELECT
(SUM(acctinputoctets)+SUM(acctoutputoctets)) AS Total FROM radacct where
radacct.username='%{User-Name}'} -> 79051669
Fri Jul  3 14:20:31 2015 : Info: sql_xlat
Fri Jul  3 14:20:31 2015 : Info:        expand: %{User-Name} -> lukup
Fri Jul  3 14:20:31 2015 : Info: sql_set_user escaped user --> 'lukup'
Fri Jul  3 14:20:31 2015 : Info:        expand:  SELECT radgroupcheck.value
FROM radusergroup INNER JOIN radgroupcheck ON radusergroup.groupname =
radgroupcheck.groupname WHERE  radusergroup.username='%{User-Name}' AND
 radgroupcheck.attribute='Max-Data' ->  SELECT radgroupcheck.value FROM
radusergroup INNER JOIN radgroupcheck ON radusergroup.groupname =
radgroupcheck.groupname WHERE  radusergroup.username='lukup' AND
 radgroupcheck.attribute='Max-Data'
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Reserving sql socket id: 3
Fri Jul  3 14:20:31 2015 : Info: sql_xlat finished
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Released sql socket id: 3
Fri Jul  3 14:20:31 2015 : Info:        expand: %{sql: SELECT
radgroupcheck.value FROM radusergroup INNER JOIN radgroupcheck ON
radusergroup.groupname = radgroupcheck.groupname WHERE
 radusergroup.username='%{User-Name}' AND
 radgroupcheck.attribute='Max-Data'} -> 5368709120
Fri Jul  3 14:20:31 2015 : Info: sql_xlat
Fri Jul  3 14:20:31 2015 : Info:        expand: %{User-Name} -> lukup
Fri Jul  3 14:20:31 2015 : Info: sql_set_user escaped user --> 'lukup'
Fri Jul  3 14:20:31 2015 : Info:        expand:  SELECT radgroupcheck.value
FROM radusergroup INNER JOIN radgroupcheck ON radusergroup.groupname =
radgroupcheck.groupname WHERE  radusergroup.username='%{User-Name}' AND
 radgroupcheck.attribute='Mikrotik-Rate-Limit' ->  SELECT
radgroupcheck.value FROM radusergroup INNER JOIN radgroupcheck ON
radusergroup.groupname = radgroupcheck.groupname WHERE
 radusergroup.username='lukup' AND
 radgroupcheck.attribute='Mikrotik-Rate-Limit'
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Reserving sql socket id: 2
Fri Jul  3 14:20:31 2015 : Info: sql_xlat finished
Fri Jul  3 14:20:31 2015 : Debug: rlm_sql (sql): Released sql socket id: 2
Fri Jul  3 14:20:31 2015 : Info:        expand: %{sql: SELECT
radgroupcheck.value FROM radusergroup INNER JOIN radgroupcheck ON
radusergroup.groupname = radgroupcheck.groupname WHERE
 radusergroup.username='%{User-Name}' AND
 radgroupcheck.attribute='Mikrotik-Rate-Limit'} -> 1024k/1024k
Fri Jul  3 14:20:31 2015 : Info: ++} # update control = noop
Fri Jul  3 14:20:31 2015 : Info: ++? if ("%{control:Tmp-Integer-0}" >
"%{control:Tmp-Integer-1}")
Fri Jul  3 14:20:31 2015 : Info:        expand: %{control:Tmp-Integer-0} ->
79051669
Fri Jul  3 14:20:31 2015 : Info:        *expand: %{control:Tmp-Integer-1}
-> 4294967295*
Fri Jul  3 14:20:31 2015 : Info: ? Evaluating ("%{control:Tmp-Integer-0}" >
"%{control:Tmp-Integer-1}") -> FALSE
Fri Jul  3 14:20:31 2015 : Info: ++? if ("%{control:Tmp-Integer-0}" >
"%{control:Tmp-Integer-1}") -> FALSE

We have to limit the max data limit for the user as 30. How we can do it?
We have to use gigawords? can anyone advice on how this can be done.


-- 
Randeep
Mob: +919447831699[kerala]
Mob: +919880050349[B'lore]
http://twitter.com/Randeeppr
http://in.linkedin.com/in/randeeppr

[image: --]
Randeep Raman
[image: http://]about.me/Randeeppr
<http://about.me/Randeeppr>


More information about the Freeradius-Users mailing list