Hi everyone,
First of all, I hope it’s okay to post this here even though I’m not currently using an OpenWRT router (the router in question is a Huawei HG8245). I’m posting here because I believe the OpenWRT community has some of the most knowledgeable and experienced people when it comes to DHCP, embedded networking, and low-level IP behavior — and this issue definitely falls in that domain.
I’m working with a fleet of embedded devices (STM32 + CycloneTCP) connected via Ethernet. These devices use DHCP to acquire an IP address from the router.
The initial DHCP handshake works perfectly: DISCOVER → OFFER → REQUEST → ACK.
The problem appears after the router reboots:
• The router forgets the DHCP lease table
• Devices still hold onto their previously assigned IPs (which are valid)
• They continue to correctly function (connected to local MQTT broker with static IP)
• Devices continue to send Gratuitous ARPs and even DHCPINFORM
• But the router does not re-learn their MAC/IP bindings
• When a new device joins the network, the router may reassign the same IP already in use by one of the embedded devices, resulting in a IP conflict.
• If router restarts before T1 of the device(s), device will try RENEW (fails), then REBIND (fails) then the next step of the device is RE-INIT DHCP (succeeds), which causes the device to drop all connections of-course, even on the LOCAL net which is unwanted.
I’ve even tested a variation(s) where the embedded device:
• Sends a new DHCPDISCOVER
• Ignores the DHCPOFFER (with a different IP)
• Then sends a DHCPREQUEST for its current IP (which is still working on the LAN)
Still, the router allways either ignores the request or does not treat it as valid without a pre-existing RE-INIT DHCP lease record.
My Question:
-
What is the safest way for a client to reassert its IP after the router has lost state — without fully restarting its network stack or breaking ongoing TCP connections (e.g. MQTT)?
-
It appears to me that some routers silently ignore a lot of the protocol, and since I am not up-to-date for what practice is deprecated while still being documented...well.. I need your help Image may be NSFW.
Clik here to view.
I’d be grateful for any insight or suggestions — configuration tricks, patches, or even best practices from other embedded projects. Thanks in advance!
5 posts - 3 participants