Alright let me kick this off with a warning to those who would reply to this thread with "Just use a router" or other unhelpful comments, there are many potential projects where multiple Arduinos are required to speak with one another and will not be close enough to one another to make use of protocols such as I2C. Some of these projects might be able to use WiFi shields, in which case they can rely on a router to handle DHCP for them, some might be plugged into a router through Ethernet with the same result. Some of these projects however cannot rely on a router, and it is for these projects that I have decided to try and create a standard DHCP Server library for use with Arduinos.
Now with that out of the way, please allow me to share what I have found to date. In my efforts to get an Arduino Mega2560 to act as a DHCP server for two UNO clients, all are using the Wiznet W5100 Ethernet shield, I dove into the DHCP client code contained within the Ethernet library. A little reverse engineering of that and I think I am close to a working, albeit ridiculously simple, DHCP server that is compatible with clients employing the Ethernet library. Now as I'm sure a quick review of the forums will tell you, not everyone who is connecting their Arduino to a network is using hardware that is compatible with the Ethernet library. For this reason I would like to reach out and see if there is anyone out there who would be willing to work with me in creating a standardized, and well abstracted, DHCP Server library to be used with Arduinos. Some of the features of this library that I have in mind are using preprocessor defines prior to the library include in order to dynamically include various features by abstracting the features to individual .h and .cpp files. This would allow the library to be as complex or small as required based on the device that it is intended to run on. These would of course be clearly demonstrated in the examples that would be included with the library.
If you are interested in contributing to this please let me know. Some areas that could be helpful are testing the DHCP server functionality on various Arduino devices, I only have access to an UNO and a Mega2560 so testing the base functionality on other devices would be extremely helpful. Code contributions are of course always welcome as well.
Since my code is not yet fully functional as even the simplest of DHCP servers I have not included a link to the Github repo for it here however I would be willing to share it upon request. At the moment I am not ready to make the library public as I am not yet prepared to support it since it is as I mentioned still not complete, there might be a bug or two lurking in there lol XD
An aside: I did look at pkulchenko's DHCPLite library, available at GitHub - pkulchenko/DHCPLite: DHCP/DNS server for Arduino, and managed to get it to work with the Ethernet library and a single client however the introduction of a second client resulted in two clients who thought they had the same IP address. This is when I decided it was time to write my own library, and seeing so many threads on this forum asking about DHCP servers on Arduinos being met with flippant replies to "Just use a router" I am even more determined to get a DHCP server library working for Arduinos.
To contact me please either reply to this thread, send me a DM, or if you really need to you can contact me directly via email at firstname.lastname@example.org