Two static DHCP leases with same IP and different MACs

Hi folks!

So I’ve got a machine (actually two machines in two different sites) that behaves awfully odd when it comes to DHCP.

When the machine is booting up, then it’ll uses one MAC (fixed) address to requests an IP using DHCP and as soon as it got one, it’ll change the MAC address to different one (also fixed) and it’ll simply continue using the previously gained IP address. After the lease time has passed, it’ll try to renew its IP with the newer MAC address - and it’ll fail, of course. This results in receiving a second IP address for the second MAC address.

I know guys, this behaviour is awful, but I checked with the manufacturer and they confirmed this to be a known bug as the machine starts using DHCP before its MAC was correctly derived and set from the device’s serial number. As I was mentioning before, I’ve got two of these machines and both behave exactly the same and they require DHCP as they do not support fixed IPs.

Okay, so I simply wanted to add two static leases to my DHCP server. One for each MAC and both pointing to the same IP address.

/ip/dhcp-server/lease> add address=192.168.1.111 comment=mac1 mac-address=36:C9:E3:F1:B8:05 server=dhcp_vlan177
/ip/dhcp-server/lease> add address=192.168.1.111 comment=mac2 mac-address=6E:3D:2F:58:6A:7E server=dhcp_vlan177
failure: already have static lease with this IP address

Sadly this results in the error message seen above. I would understand receiving a warning, but completely rejecting it seems a bit too much.

The 2nd machine is at a different site where a pfSense is used as DHCP server, where I can simply add two static leases with same IP and different MACs, and the DHCP server will simply assign identical IPs to both DHCP requests from those two different MACs, at least when I turn off conflict detection. This works fine even before the first lease has fully expired.

So my question is pretty simple: How can I achieve the same behaviour with RouterOS, so my device doesn’t wildly jump between two IP addresses?
It is always ensured, that only one of two MAC addresses is active as the device simply changes the MAC of its network adapter while booting up.

Any ideas?

Does the device provide a client-id?
Maybe that one remains the same.
(IP addresses can be assigned on both client-id and MAC, client-id should prevail, but it should be possible to use only client-id)
http://forum.mikrotik.com/t/dhcp-clientid/53010/1
http://forum.mikrotik.com/t/dhcp-mac-vs-client-id/147910/1

Nah…would be too easy… Client-Id is “1:MAC”, but even this wouldn’t allow me to enter two statics for the same IP address.
I have an ancient topic from more than 10 years ago when mikroTick wasn’t able to do that and everyone was sayin’: “Use ISC-DHCP!”…
…and somehow I’m hoping that RouterOS has evelved since back then…

So, client-ID changes as well?
Pity. :frowning:

There is a workaround (or ugly hack) using ip pool, cannot say if It can work in your setup:
http://forum.mikrotik.com/t/dhcp-server-static-lease-one-ip-multiple-mac/11767/1