Community discussions

MikroTik App
 
blacky
newbie
Topic Author
Posts: 27
Joined: Sat Sep 18, 2010 8:28 pm

Problems getting MAC-Auth working with Radius and SQL

Fri Apr 08, 2011 9:02 pm

Hi there,
i'm trying to get my Hotspot running with MAC Authorisation and Freeradius/SQL.
I've setup the Hotspot on my Mikrotik and its working fine with local user. I created a local user with the MAC as the username. It works fine. But when i try to authenticate with the Freeradius it doesnt do it. It works fine as long as i use a username and password in the database but when i try to put the MAC address as the user and blank password nothing happen. their are several topics about and i searched the net for about two days without any luck..

In my SQL Database i have only a usergroup with my users
and under the table "radreply" my user with the password.
Quit basic but for testing its fine. I though i don't need more cause the local Mikrotik Radius also just needs the Mac address as a user.

Can someone give me a favor please?

Sven
 
blacky
newbie
Topic Author
Posts: 27
Joined: Sat Sep 18, 2010 8:28 pm

Re: Problems getting MAC-Auth working with Radius and SQL

Tue Apr 12, 2011 10:33 am

Ok, i sorted this out.
But next question is this one:

Our customers log in only with their MAC-address (from their Laptop or a Router that is connected to our network)
This MAC is stored in the Radius SQL Database. Now when we delete the user from the database he can still use the internet. How can we terminate the session when we delete the user from our database? We offer only 1 day, 1 week, 1 month access so maybe their is a solution over session-time? Hope you can help me.

Sven
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Problems getting MAC-Auth working with Radius and SQL

Tue Apr 12, 2011 11:24 am

How can we terminate the session when we delete the user from our database?
http://wiki.freeradius.org/Disconnect_Messages

I use this method and it works fine. The disconnect message must be originated from the RADIUS server though. It cannot come from an outside server.
 
blacky
newbie
Topic Author
Posts: 27
Joined: Sat Sep 18, 2010 8:28 pm

Re: Problems getting MAC-Auth working with Radius and SQL

Tue Apr 12, 2011 11:50 am

http://wiki.freeradius.org/Disconnect_Messages

I use this method and it works fine. The disconnect message must be originated from the RADIUS server though. It cannot come from an outside server.
When i try this i get a "no response from server" mesage.
I activated the incoming option on port 3799 in my mikrotik.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problems getting MAC-Auth working with Radius and SQL

Tue Apr 12, 2011 4:33 pm

If you want the user to be logged out when his account expires in the database I wouldn't use DMs, I would use the RADIUS attribute that tells the router when to log a user out. See the RADIUS client wiki for a list of attributes. You can get the value to send back by using DATE_SUBTRACT combined with NOW() and your expiration date column, details depend on your SQL dialect.

Who is online

Users browsing this forum: GoogleOther [Bot], Josephny, McSee, RobertsN, sindy, tdw and 53 guests