Hello guys, Good morning
So I want to convert my dynamic address list entries to static with script for individual address list, not all at once.
Help me please. I'm using CCR1016.
Thanks in advance
Hello, I was talking about these in Firewall.viewtopic.php?t=147251
This converts new DHCP leases to static IP in RouterOS
{
local targetList "Zoom"
foreach item in=[/ip firewall address-list print as-value where dynamic list=$targetList] do={
if ([len [/ip firewall address-list find list=$targetList address=($item->"address") !dynamic]]=0) do={
/ip firewall address-list remove [find list=$targetList address=($item->"address") dynamic]
/ip firewall address-list add list=$targetList address=($item->"address")
}
}
}
{
:local targetList "Zoom"
/ip firewall address-list
:foreach item in=[find where list=$targetList and dynamic=yes] do={
:local addIP [get $item address]
remove [find where list=$targetList and address=$addIP]
add list=$targetList address=$addIP
}
}
:do {:foreach i in=[/ip firewall address-list find list=("temp".$listname)] do={/ip firewall address-list set list=$listname $i }} on-error={}
/ip firewall address-list
{
:local targetList "Zoom"
remove [find where list="temp-$targetList"]
:local search [find where list=$targetList and dynamic=yes]
:foreach item in=$search do={
add list="temp-$targetList" address=[get $item address]
}
remove $search
set [find where list="temp-$targetList"] list=$targetList
}
Here you goHow do you populate the Address-List ?
Is it possible to share the config of your Mikrotik devices?
/export hide-sensitive file=anynameyoulike
This can not be used. post output ofHere you go
/export hide-sensitive