not getting same ip for same MAC
dhcp1 at thehobsons.co.uk
Wed Aug 8 17:40:49 UTC 2018
Christopher Barry <christopher.r.barry at gmail.com> wrote:
> I'm booting an embedded device via u-boot over tftp, and I am getting
> one IP during boot, and another IP once Linux comes up.
> In the leases file it can be seen that the uid value is different
> between u-boot and linux, even though the MAC is the same.
This is a known issue. The DHCP spec requires that the Client ID (uid in the leases file) is used as the primary key in the lease database, the MAC address is not used at all if there is a Client ID provided.
There are 4 ways around this :
1) Just enlarge your pool
2) Use classes to make the u-boot and Linux use different pools. The booted Linux will then behave as you were used to. In a production environment, it can also be used to give the bootloader a short lease so that a smaller pool can be used.
3) Configure one or both clients so that they both use the same Client ID, or both use no Client ID
4) A long time ago someone wrote some patches - though I don't think they would be applicable to your case. IIRC the patches did something like "if there is no Client ID, add one using the MAC address" and were intended to deal with the known "Linux doesn't send a Client ID, Windows uses the MAC address" dual boot issue.
More information about the dhcp-users