Community discussions

 
User avatar
Adrin
just joined
Topic Author
Posts: 5
Joined: Wed Sep 02, 2009 10:30 am
Contact:

hotspot with freeradius on mysql - rx/tx settings

Thu Mar 08, 2012 3:34 pm

Hello,

we have a few hotspots running on MT. And now we want to centralize user authorization with freeradius server.
Everything is working fine (in testing enviroment), but I was not able to find out how to set freeradius and hotspot to change rx/tx limits separatly for every user.

On radius server there is a file /usr/share/freeradius/dictionary.mikrotik (which is loaded - I test it) and in this file there is attribute Mikrotik-Rate-Limit (described here: http://wiki.mikrotik.com/wiki/Manual:RADIUS_Client).

I hoped that this attribute can be used to set rate limits for single user. But setting up this attribute do not do anything special on hotspot (user logs in, internet is accessible, Max-All-Session works fine, but speed is limited only by hotspot global limit - not limit of this user).

Here is output from table radcheck:

6 adam Password == xxx
2 adam NAS-Identifier == mikrotik
5 adam Max-All-Session := 7200
8 adam Mikrotik-Rate-Limit := 64k/64k

RouterOS is 5.14

Is this setting correct? Do I have to do any other settings on hotspot side?

Thank you,

Adam.
 
reverged
Member Candidate
Member Candidate
Posts: 270
Joined: Thu Nov 12, 2009 8:30 am

Re: hotspot with freeradius on mysql - rx/tx settings

Thu Mar 08, 2012 6:10 pm

I use freeradius and MT hotspot. I have per user rate limits using Mikrotik-Rate-Limit.

Turn radius logging on and verify that the rate limit makes it to your ROS device.

You should see the authentication request and reply in the log. The radius attributes sent from the server will all be shown in the log.

Are you using the default user profile? If not, then you have to specify the Mikrotik-Group attribute in your radius response. That tells the hotspot which user profile to apply.
 
User avatar
Adrin
just joined
Topic Author
Posts: 5
Joined: Wed Sep 02, 2009 10:30 am
Contact:

Re: hotspot with freeradius on mysql - rx/tx settings

Fri Mar 09, 2012 1:14 pm

Hello and thank for reply.

I did log debug info as you sugested and there was no Mikrotik-Rate-Limit appeared. So I read some tutorials for freeradius again (http://wiki.freeradius.org/SQL-HOWTO) and here is solution:

table radcheck:
6 adam Cleartext-Password := xxx
2 adam NAS-Identifier == mikrotik
5 adam Max-All-Session := 21600

table radreply:
2 pokus Mikrotik-Group := test
3 adam Mikrotik-Rate-Limit := 64k/64k

I em not sure about its 100% correctness. I em still confused when to use operator == and when :=
But this works as I wanted.

If someone has any additional suggestion, I will be happy to receive one.

Thank you,

Adam.
 
Turamarth
newbie
Posts: 29
Joined: Wed May 09, 2012 3:25 am

Re: hotspot with freeradius on mysql - rx/tx settings

Wed May 09, 2012 4:04 am

Im trying to manage hotspot user-profiles from mysql database and i could not make the users use the correct profile. i tryed with

username Mikrotik-Group := test
and
username Mikrotik-Rate-Limit := 64k/64k

but nothing, the user still using full bandwith.

Any idea? thx :)
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: hotspot with freeradius on mysql - rx/tx settings

Sun May 20, 2012 7:27 pm

You need to set these values in the radreply table, not radcheck, you should be doing something like this in SQL

INSERT INTO radreply (username, attribute, op, value) VALUES ('freddy', 'Mikrotik-Group', '=', 'myusergroup')
INSERT INTO radreply (username, attribute, op, value) VALUES ('freddy', 'Mikrotik-Rate-Limit', '=', '64k/64k')

If this works then you should see a queue appear under Simple Queues with the right limiting on it.

If you just need group based speed limiting then create a user profile and then assign the Mikrotik-Group reply attribute to the users, then they will be limited by whatever is setup in that user profile.

Regards
Paul
 
Turamarth
newbie
Posts: 29
Joined: Wed May 09, 2012 3:25 am

Re: hotspot with freeradius on mysql - rx/tx settings

Tue May 29, 2012 3:38 pm

thx for reply, actually the problem was in the op value in db.

now is working fine. thx :)
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: hotspot with freeradius on mysql - rx/tx settings

Wed May 30, 2012 5:10 pm

Ah yes, those operators are painful to get the hang of....
Glad you got it sorted.

Paul
 
fruiz002
just joined
Posts: 13
Joined: Fri Jan 06, 2012 1:35 pm

Re: hotspot with freeradius on mysql - rx/tx settings

Fri Jul 06, 2012 2:44 pm

Hello,

I have a Daloradius system that intends to control a couple of hotspots, I would like the users to pya for a certain time, then get disconnected and have to pay another time to connect. Can anybody give me a clue? I know that I have to use max all session and I have followed a couple of posts, but it does not work, the user is simply not disconnected.

Thanks in advance

Regards
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: hotspot with freeradius on mysql - rx/tx settings

Fri Jul 06, 2012 3:47 pm

I am assuming that you are using Mikrotik for the hotspots ?
You can only set a maximum session time with usermanager, radius does not have an attribute that will support that feature, you have to run scripts and reset the remaining time yourself.

Paul

Who is online

Users browsing this forum: No registered users and 85 guests