/ip firewall rule test
add src-address=10.10.10.10/32 action=drop comment=“ACCEPT me”
add action=drop comment=“DROP the rest”
What I would like to do is use find to allow me to manipulate only those items in the list that have “DROP” in the comment. I will not have the full text of the comments, as they are different, but ALL will have a common portion (i.e.: DROP or ACCEPT). I looked in the scripting manual, but could not get much beyond the fact that it seems possible. Any insights?
Hi, how would this work if you wanted a MAC address from say a DHCP lease? That way it’d be possible to run WOL to a classroom/office area based on computer name.
:foreach i in [/ip dhcp-server lease mac find] do={
:if ("." . [:find [/ip dhcp-server lease get $i active-host-name] "Student-Class2"] . "."!="..") do={
*******
/tool wol mac=$j interface=LAN
}
}
I think I need another search call to first get the MAC address off the list then pass it to the final command. Still quite new to it so please excuse the ignorance to the extra command needed (*****)