Mbed6 and DHCP lease renewals don't seem to work

We’ve used MBed5 for some years and brought up out Ethernet connection with DHCP. Basically the below code. I’ve removed the error handling to keep it short.

    EthInterface * eth = EthInterface::get_default_instance();
    eth->set_dhcp( true );

On MBed5 this worked ok and we always got the IP address data. DHCP renewals also seemed to work ok. Now we’ve finally migrated to MBed6 and while the DHCP code always gets the interface up and running it doesn’t seem to renew correctly. It took ages for us to notice as the lease time was two weeks at the office where devices were tested. After the lease has expired network operations seem to give NSAPI_ERROR_NO_CONNECTION errors.

Are we supposed to manually handle the DHCP renewals with MBed6? Or should renewals work automatically? According to the standards a DHCP client should try to renew after half the lease time has passed, so there has been ample time to renew. I don’t really see any way to check the DHCP data nor manually do the renewing, unless we want to drop down to the low level LWIP code and do an own Ethernet interface.


Hi chakie,

I’ve also observed that DHCP clients fail to renew their leases properly. See my recent post for more information: Odd DHCP Client Behavior Using EthernetInterface - Mbed OS / Bugs - Arm Mbed OS support forum.

Based on what I’ve seen and on your post, it does seem to be an issue with one of Mbed’s libraries. Have you had any luck correcting this behavior since your post?

Sorry I couldn’t be of any actual assistance, but I thought it would be useful to get all of this information in one place.