Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have freeRadius up and running with the mysql extension. Currently I am authenticating devices using their mac-address which is stored in a text file (as per I would like to move the mac-addresses in to a mysql database. What is the best way of going about this? Any insight would be much appreciated.

share|improve this question
up vote 2 down vote accepted

Figured out a way using SQL xlat. The FreeRadius wiki has an extra " that was causing the sql xlat to fail. Here is the solution:

Go to the FreeRadius wiki. You can skip the sections labeled 'raddb/modules/file' and 'raddb/authorized_macs'. When you get to the final section 'raddb/sites-available/default post-auth{}' use the following code instead:

if("%{sql:SELECT COUNT(macaddr) FROM radmacauth WHERE macaddr ='%{User-Name}'}" > 0){

You will need to create a table named 'radmacauth' with a field named 'macaddr' in your radius database.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.