I would like to ask is it possible to make the rule from dynamic to static automatically?
For example:
chain=input action=add-src-to-address-list protocol=tcp dst-port=23
address-list=blocking-list-here address-list-timeout=0s/ip firewall address print
LIST ADDRESS TIMEOUT
D blocking-list-here 115.112.232.64D = dynamic, how to make it static automatically?
Because if dynamic, when router restarts, the list will be gone.
:local workinglist value="blocking-list-here";
:foreach i in=[/ip firewall address-list find where dynamic=yes and list=$workinglist] do={
:local thisadd value=[/ip firewall address-list get $i value-name=address];
/ip firewall address-list remove [find where list=$workinglist and address=$thisadd];
/ip firewall address-list add list=$workinglist address=$thisadd;
}
ANY WAY YOU USE, YOU MUST MOD YOUR RULE
FROM THIS:
chain=input action=add-src-to-address-list protocol=tcp dst-port=23 address-list=blocking-list-here address-list-timeout=0s
TO THIS:
chain=input action=add-src-to-address-list protocol=tcp dst-port=23 address-list=blocking-list-here address-list-timeout=0s src-address-list=!blocking-list-here
set dynamic=no surely not exist on 6.7 and before,
I do not know on what precise 6.8+ version is added, but for compatibility with 6.x and 5.x is better my script.