I want to use this easy script, to drop the complete dynamic host with one firewall rule.
http://wiki.mikrotik.com/wiki/Use_host_ ... wall_rules
But since the FW 6.2 released, the script seems to be incompatible with the FW 6.2.
Knows anyone why? Thank you for any help:)
I mean this script:
/system script add \
name=resolvehostnames policy=write,read \
source="# define variables\r\
\n:local list\r\
\n:local comment\r\
\n:local newip\r\
\n:local oldip\r\
\n\r\
\n# Loop through each entry in the address list.\r\
\n:foreach i in=[/ip firewall address-list find] do={\r\
\n\r\
\n# Get the first five characters of the list name\r\
\n :set list [:pick [/ip firewall address-list get \$i list] 0 5]\r\
\n\r\
\n# If they're 'host_', then we've got a match - process it\r\
\n :if (\$list = \"host_\") do={\r\
\n\r\
\n# Get the comment for this address list item (this is the host name to u\
se)\r\
\n :set comment [/ip firewall address-list get \$i comment]\r\
\n :set oldip [/ip firewall address-list get \$i address]\r\
\n\r\
\n# Resolve it and set the address list entry accordingly.\r\
\n : if (\$newip != \$oldip) do={:set newip [:resolve \$comment]\r\
\n /ip firewall address-list set \$i address=\$newip}\r\
\n }\r\
\n }"