Dynamic to Static automatically

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.

Good question. If not directly it could be done maybe by subsequent script I guess.

Thanks. Could anybody help me with a simple script for it?

I would like to suggest to Mikrotik that
if users do address-list-timeout=0s (unlimited), the address list should be Static.

/ip firewall address-list set dynamic=no [find dynamic]

Are you tried this line?
Is present one syntax error “addres-list” (must be addres**s**-list) and set dynamic=no not exist

sorry, I posted from my mobile phone.
is ok now.

rextended:

[admin@homeAP] > /ip firewall address-list set dynamic=no [find dynamic]
[admin@homeAP] >

tested in 6.15.

This is for you, working on 5.x and 6.x RouterOS:

: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

for not duplicate the entry.

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.

Thanks!





It works, many thanks!