ARP make script script

Hello,

I appreciate the forum users and mikrotik support people who are making a valuable help in configuring the great reliable routes

My request for the script is ip arp when ever the client trying to connect through router the script should automatically make static the entry


Please help me in writing this script

Thanks,
Sathish

Hello,


while searching i found the script, which works great only on v2.9 , mine is v5.7 please help
only one mac address in making static in the log
:local dmac
:local smac
:local dip
:local sip
:local iface
:local exist
:foreach i in [/ip arp find dynamic=yes] do={
:set exist false
:set dmac [/ip arp get $i mac-address]
:set dip [/ip arp get $i address]
:set iface [/ip arp get $i interface]
:foreach j in [/ip arp find dynamic=no] do={
:set smac [/ip arp get $j mac-address]
:if ($dmac=$smac) do={
:set sip [/ip arp get $j address]
:set exist true
}
}
:if ($exist!=true) do={
:log info ("Adding ARP entry with MAC " . $dmac . " and IP " . $dip)
/ip arp add copy-from=$i
}
}


Thanks,
Sathish