a few dhcp-server leases with the same IP-address

Hi, how do I make RouterOS lease same IP-address to a few devices via DHCP?

Now I’ve got this

> ip dhcp-server lease add copy-from=0 mac-address=54:c9:df:b7:ff:b8 server=k16_1 
failure: already have static lease with this IP address

I don’t think you can. Normally it doesn’t make sense, because different devices with same address wouldn’t work correctly. I can imagine special case where you’d always connect only one at the time, then it would be ok. But I’m affraid that if the check wasn’t there, then for every case where it would help, there would be thousand of others where people would reserve duplicate addresses by mistake, so I can understand why it’s not allowed.

well if one have a few isolated subnets or VRFs?
maybe any different dhcp-server instances could have records with same IP?

Nope, I tried, but not even two instances allow to have reservation for same address. But I would expect that it should be possible. Unless there’s some option I missed, you’ll have to convince MikroTik that it’s bug or unnecessary limitation.

maybe use this https://wiki.mikrotik.com/wiki/Manual:Tools/Traffic_Generator to simulate dhcp answer packets somehow?
how to trigger this

tool traffic-generator inject

command on DHCP request arrival?

Sounds too crazy even by my standards, and I like crazy hacks. DHCP server has lease script, so you can run something, but you’d also need a way how to prevent it from sending its own response. You can’t do it with IP firewall, because if I remember correctly, it uses raw sockets. Such filtering could maybe work if you didn’t have bare interface, but you’d add it as bridge port, then bridge firewall could do the trick. You’d need to block packets to selected MAC addresses (which would block server’s response), then disable it for a moment to send your packet, and enable it again. Maybe it could really work, if you’re able to construct proper packet with response, but it would be insane.

Sane options are to either get another DHCP server that would allow this, or write to MikroTik and explain that you have valid use case and they should remove current limitation (perhaps as an option).