This weekend i was working in a script that someone asked in the forum, i couldn't find the topic, so here you have
Is useful to know who is connect in which access point in Capsman. Capsman only shows mac-address, so this script search this mac-adress in dhcp-lease and create an access-list whit the mac and the same comment in DHCP. The result you will see in registration table the name that you have already set in static dhcp-lease list.
You can schedule this script for example each 4 hours, if someone new is connect (and you have it static dhcp lease) it will be add it. Be careful to make it often, remember each time you add some entry in access-list, your capsman will disconnect for a few seconds all clients and them they will connect again.
Code: Select all
:local maccaps
:local macdhcp
:local name
:foreach i in=[/caps-man registration-table find ] do={
:set maccaps ( [/caps-man registration-table get value-name=mac-address number=$i])
:foreach j in=[/ip dhcp-server lease find ] do={
:set macdhcp ( [/ip dhcp-server lease get value-name=mac-address number=$j])
:set name [/ip dhcp-server lease get [find where mac-address=$macdhcp] comment ]
:if ($maccaps = $macdhcp ) do={
/caps-man access-list disable [find mac-address=$macdhcp]
/caps-man access-list add mac-address=$macdhcp comment=$name
}
}
}
/caps-man access-list remove [find where disabled]