Mikrotik Rate Limit attribute from query.

Carlos Botejara cbotejara at gmail.com
Thu Oct 13 02:42:07 UTC 2022


Hi All.
I'm migrating ClearBox Radius Software to freeradius, And I need to pass
the attribute Mikrotik-Rate-Limit via query.

The Query for ClearBox is:
"SELECT 'Mikrotik-Rate-Limit' AS Expr1, \
  CASE WHEN sync = 1 THEN \
   REPLACE(CAST(idvelocidad as char) + 'K',' ','') \
   ELSE \
   REPLACE(CAST(idvelocidad /2 as char)+'K/'+ CAST(idvelocidad  as
char)+'K',' ','') \
   END \
   AS Expr2 \
  FROM SubAccounts with(nolock) \
  WHERE Login = '%{SQL-User-Name}'"

This query takes the bandwidth of a table in the CRM software. If the
client is a business (synchronization), the bandwidth is symmetric, but if
the client is an ordinary client, the bandwidth is not symmetric and the
upload bandwidth is divided by 2 and the upload bandwidth is divided by 2.
download is integer.

How can I keep this in freeradius and pass the parameter through a query?

Thanks


More information about the Freeradius-Users mailing list