DHCP Server Lease SCRIPT - HELP

I try to do this alone or to find something similar, but problem still exist, i cant solve that alone.

My problem is: I want, when some client got ip adress from DHCP server, to tell script to find that dynamical ip address, to make static from them and to give (change address) to that client first ip adress from my IP Pool. That is similir to manualy make-static from dhcp and write ip address in checkbox, but i need script to do that becouse i have many clients. Thanks in advance…

See this

Haven't tested this... but you want something like this...

*. by RouterOS

DHCP Leases to Static DNS

On-Lease Script

Variables

:local scriptComment "DHCPMakeStatic"

Globals

:global leaseBound
:global leaseServerName
:global leaseActMAC
:global leaseActIP

Script

:set scriptComment ("+" . $scriptComment)

Insert on Bind

:if ($leaseBound = 1) do={
/ip dhcp-server lease {
:foreach i in [find dynamic address=$leaseActIP] do={
make-static $i
}
}
} else={

}

Yes, i want something like that, but i tested and something here is wrong, but i dont know what :smiley: I can make static with this command /ip dhcp-server lease make-static find dynamic server=xxxxx] and with that command i make static all dhcp lease address from specific dhcp server, but i need more :smiley: I need to change that address, one by one with script, example if client got ip addres 192.168.0.190, and script make static for that address, i need from script than to change that ip address from .190 to .131