Hi guys, I would like to know how to make a script to be run when a specific IP address is not detected in the ARP table. For example
If ip addres 10.70.3.5 in arp table is not registered then
enable ip address 10.70.1.1/30
and when ip address 10.70.3.5 is detected in arp table again
disable ip address 10.70.1.1/30
this would be on a scheduled task to be run every 10 seconds
Thank you so much for all your help!!!
It is not pretty but it works on my test environment:
Oneliner style
:if ([/ip arp print as-value where address="10.70.3.5"] = "") do={/ip address enable numbers=[/ip address find where address="10.70.1.1/30"]} else={/ip address disable numbers=[/ip address find where address="10.70.1.1/30"]}
The same code in readable format
:if ([/ip arp print as-value where address="10.70.3.5"] = "") do={
/ip address enable numbers=[/ip address find where address="10.70.1.1/30"]
} else={
/ip address disable numbers=[/ip address find where address="10.70.1.1/30"]
}