Freeradius + Mikrotik - How to use Accounting right!

Hi there, I was asked to open a new post on this subject and here I am. Im actually researching on how to use Accounting correctly with the MySQL tables from FreeRadius and the Mikrotik RouterOS System. Well, first of all… I think we need to start on how to set limitations to a user basis in their logon on the hotspot system. I want to know also how can I get RouterOS to send all Accounting info to my tables in MySQL! They have to be diferent from the original ones with freeradius because of some namespace(Mikrotik only Variables)? Im actually using DialUP Admin from Freeradius as a manager to fill my structures with basic data, but it does not show the accounting info when I try to view it. Maybe its a problem on my Freeradius config or on my MySQL, but just in case its on RouterOS this topic is well posted here on mikrotik forum. Any help or considerations will be Welcome. Thx in advance.

I am not certain what you mean by “different than freeradius”, but here is the rest:

The time/bandwidth accounting should already be sent to the MySQL radius database in the radacct table. Check there to see if they are being put there. If not, check your “/ip hotspot profile” and insure that “radius-accounting=yes”. Setting the radius-location-name helps identify the hotspot in radacct.

I send
attribute=Acct-Interim-Interval value=600
with each user authentication. That causes it to send the accounting info to the RADIUS server every 10 minutes.

I dont know if its right but i typed “SELECT * FROM radacct;” and it shows empty. About the interim update I placed 30 seconds just to see if it would send acc packets to radacct but nothing showed up. Thats why Im a little confused about how accounting works. As it is configures it should already been populating the tables with data but this isnt hapenning. I can’t figure out if its a FreeRadius, MySQL or RouterOS config problem. Thx for the reply dude :slight_smile:, Any more help will be welcomed, until there I will keep working and researching here to make this work right!

I would use 600 for the Acct-Interim-Interval, but that should not really matter. The user login should show up there.

Just to check…You don’t have port 1813 blocked anywhere, do you? Remember Auth port=1812 Acct port=1813.

Just to check - you have configured FreeRADIUS to log to MySQL instead of its default flat files (usually in /var/log/radius/radacct/, though that may differ by OS)?
Does the the daemon log show any errors connecting to the database?

Hi there, I already checked those rules in My filter in firewall and its fine… 1812 and 1813 TCP and UDP has Accept rule!!!

There is not much more remaining! Check the accounting section in your radiusd.conf file and see if the sql is unremarked. Must be sql, not #sql. unix, radutmp and sql should be the only accounting methods unremarked.

ADD: Check the directory assignments at the top of radiusd.conf. See where your radacctdir is located. Check there to see if you are getting any interim updates. They are in directories according to IP, and in each are the interim updates by day. Mine are in “detail-20090827” for today.

I have the same problem, Acct-Interim-Interval=10 but no interim packets belong to my radius server.