I would like to log the users Mac address to a database hosted on a web server. I was wondering if there is a variable I can use like for example $mac-address which will replace it with the users mac address.

I think of using that variable in a hidden field and when the form is submitted I'll log the info to a database.

Is this even possible? Cause I know in the status page under the hotspot folder, you see the mac address of the device connected.

I also tried using $(mac) nothing.


  • Routers always log the MAC address to whatever system logger the router is using upon a DHCP request, so it's fairly straightforward from there by searching the system log at set intervals with regex since the MACs will always be in the same hexadecimal format of <A-F><0-9>:...:...:...:...:..., then piping it to a database or using whatever way you wish to assign the variable then import.
    – JW0914
    Dec 8 '19 at 13:58

Several ways to achieve that, in my personal preferred order:

  • Log the Wifi activity and send it to a syslog server, wich will log data on a database. You will have exact connect/disconnect times of everything connecting to your AP.
  • Use a C# (for example) program with Mikrotik API to "listen" for incoming MAC addresses, and log them in a database.
  • Query your Mikrotik AP using SNMP or API to get the list of connected MAC-addresses: you'll get snapshots of connected people every minute for example.
  • But it is already built in...for example if you use the built in hotspot feature...in the status page it shows the MAC address just by using a simple tag. I was wondering if it is possible to have that on other pages, that are hosted elsewhere?
    – Nikk
    Aug 13 '15 at 22:16
  • Yes, syslog is the easier way to do that. Aug 16 '15 at 14:00
  • But it doesn't seem to work, it is supposed to replace the tag with the Mac address but it doesn't..is there a way to turn it on?
    – Nikk
    Aug 17 '15 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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