0

I have a microcontroller based device with a bootloader and an application. The device has one Ethernet adapter. The bootloader uses IP/UDP to flash the application image. The application has a full featured TCP/IP stack.

Both components uses DHCP to get an IP address. The strange thing is that both get different results in the DHCP process. Both DHCP clients are configured to use a DHCPDISCOVER message with the same MAC address.

What should a DHCP server send in DHCPOFFER? Should it offer the same IP address for the same MAC address when the IP address is not assigned elsewhere? Edit: The last address assignment is 10 seconds ago.

The DHCP Server is running on a Linux host. How can I configure such a vehicle so that I can monitor and understand this behavior?

Edit: I don't have control over the DHCP server configuration. The administrator wants to keep full control.

Are there other DHCP settings that could be in the bootloader or in the application that could affect the DHCP result?

2 Answers 2

1

It depends on your lease time setting. If it's long enough, then your app will get the same address.

But if you want assurance then declare fixed adress for your mac on server.

If you using dhcpd, then something like that:

host foo {
  hardware ethernet 00:11:22:33:44:55;
  fixed-address 1.2.3.4;
}

Actualy yes, there is a way to suggest IP in DHCPDISCOVERY by setting option (50) requested IP address. But I don't know if servers acknoledge that.

There is also option (51) IP address lease time, that could be used in boot loader to suggest longer period, but I'm as well not sure about server response.

More info rfc2131

1
  • The question wasn't ment to be related to the lease time. Of course if the leas has expired, everything can happen. More interesting is the behavior on two consecutive DHCP DISCOVER within some seconds.
    – harper
    Dec 5, 2013 at 19:12
0

When a DHCP client sends a DHCPDISCOVER then the server should discard the DHCP registration. There are servers that will get the same IP address. That's not wrong but even not necessary.

To keep the DHCP address the client must send a DHCPACQUIRE with the cached IP configuration. The DHCP server will confirm or deny. Sending DHCPDISCOVER is just a bad idea in this situation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .