Paste this on dhcp-client / advanced / Script:
/ip address remove [find where comment="autoadded"]
:if ($bound = 1) do={
:local iface $interface
:local assignedip [/ip address get [find where interface=$iface] address]
:local startip [:toip [:pick $assignedip 0 [:find $assignedip "/" -1]]]
:local subnetip [:pick $assignedip ([:find $assignedip "/" -1] + 1) [:len $assignedip]]
:for x from=1 to=10 step=1 do={
:if ([:len [/ip address find where address="$($startip + $x)/$subnetip"]] = 0) do={
/ip address add comment="autoadded" interface=$iface address="$($startip + $x)/$subnetip"
}
}
}
Caveat:
The script ignore on purpose the subnet mask.
If the IP is, for example, 192.168.88.247/24, this procedure add:
192.168.88.248/24
192.168.88.249/24
...
192.168.88.
255/24
192.168.
89.0/24
192.168.
89.1/24
Remember:
When lease is
added, or
changed, the script, removing first previous IPs,
add the IPs,
when lease is
expired (and not renewed),
released or
removed,
remove all IPs added,
when lease is
renewed, do
NOTHING (keep added IPs).
When the DHCP Client is deleted (removed) or disabled, the IPs are also deleted if the script is present.
On reboot the IPs are keeped, until the DHCP Client do not obtain again one lease.