Why does a DHCP4 client not respond to the DHCP Offer from a DHCP server

androiddhcpdhcp-serverisc-dhcp

An extremely simple DHCP server works reliably with Windows 10 PCs and Android devices. It receives DHCP Discover from a client, replies with DHCP Offer, then receives DHCP Request from a client.

However, it does not work with a device using DHCP4. It receives DHCP Discover from it, and replies with DHCP Offer, but never receives DHCP Request from the client. This is confirmed by Wireshark analysis. It appears the DHCP4 client either noes not receive the DHCP Offer or completely ignores it.

The DHCP client works with different routers' DHCP servers without any problem, so I blame the DHCP server.

This DHCP server has one thing different from a typical DHCP server: it does not use the privileged port 67 as the source port to send messages. I thought DHCP clients would not care about the source port of the replies to their DHCP Discover. The protocol does not seem to require the messages from the server to be sent from port 67. It requires them to be sent to port 68.

Could any experts offer some clues about the issue? I have the complete control of the DHCP server, and I will be very happy to try any suggestions.

Edit:

Please note this question is not for making any particular device running DHCP4 work with the DHCP server. This question is about how to modify the DHCP server so that it will work with all DHCP4 clients.

Best Answer

I suspect an android limitation (and I can't see a legal use to make a DHCP server app on android either). Please see RFC2131 for further reference.

DHCP uses UDP as its transport protocol. DHCP messages from a client to a server are sent to the 'DHCP server' port (67), and DHCP messages from a server to a client are sent to the 'DHCP client' port (68).

Related Topic