Well as i can see, from script there’s no way to add something to address list permanently. Which would be nice in some cases, atm when you set timeout to infinite it still goes away on reboot.
Could this be fixed? ![]()
Best Regards
Carl
Well as i can see, from script there’s no way to add something to address list permanently. Which would be nice in some cases, atm when you set timeout to infinite it still goes away on reboot.
Could this be fixed? ![]()
Best Regards
Carl
Not sure what you mean
/ip firewall address-list add list=test address=1.1.1.1
address will stay there forever unless configuration is removed, router is reset, reinstalled or NAND destroyed.
If you run it inside a script it’ll be marked with a D, which means it’ll go away once restarted. From terminal it stays forever.

If i reboot my router all the SSH_Blocklist stuff will go away.
Best Regards
Carl
I run scripts that add static address list entries all the time and the following works perfectly for static entries.
/ip firewall address-list add address=1.2.3.4 list=My-List
Now if you use the one below it will become dynamic since I specified “timeout”
/ip firewall address-list add address=1.2.3.4 list=My-List timeout=30d
Exactly, if you want to add addresses permanently, do not specify timeout.
I’m so stupid, what i did was i created them from a firewall rule… I’m terribly sorry!

This makes it dynamic, i guess i’ll have to make a script iterating that list and adding them from script to another list.
Made a script for this:
EDIT:
:foreach i in=[/ip firewall address-list find list=SSH_Blocklist] do={
:local ipaddress [/ip firewall address-list get $i address]
:local dynamic [/ip firewall address-list get $i dynamic]
if ($dynamic = true) do={
/ip firewall address-list remove $i
/ip firewall address-list add list=SSH_Blocklist address=$ipaddress
}
}