Tue Oct 04, 2011 4:48 pm
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