Using Domain or Realm with MAC authentication and Radius

Hi

Im trying to make use of MAC authentication on the hotspot service using freeradius. It works fine if I simply add the users MAC into the radius database, but as our servers cover multiple locations (circa 300) I need to only allow access to that user at the site that allows them to use mac authentication.

Im sure theres a way to append a domain or realm to the access request sent to the radius server - i assumed it would append it to the actual username but It appears from the freeradius logs that its using another attribute to send the information.

Does anyone know how I can tie the two together to end up with usernames like MACADDRESS@SITE being sent to the server - or a way to get the server to append the domain onto the username at prior to authentication?

Free pint of lager at the MUM for the correct answer, plus a special bonus of an atta-boy now.

solved:

For anyone that needs to do this, append this to the /etc/freeradius/hints file:

DEFAULT User-Name !~ ".*@"
     User-Name := "%{User-Name}@%{Mikrotik-Realm}"

That will append the Realm set in the Mikrotik device to usernames that don’t have an @ in them