I am using an esp8266 wifi module if that matters. What I intend to do is connect the module to my home router and have other modules connect to this module and form a second layer, and to this second layer other modules can connect forming a third layer and the network expands so on, essentially a tree like network topology. The first module that connects to the home router will make it's own private IP range independent from home router ip range and we will further subnet this. So we start from:
- 10.0.0.0/8 for the first module. It takes the ip 10.1.0.0
- It offers 10.2.1.0/16, 10.3.1.0/16 ... 10.254.0.0/16 through DHCP
- 10.2.1.0/16 can further give 10.2.2.1/24, 10.2.3.0/24 and so on till 10.2.254.0/24 through DHCP
- 10.2.2.1/24 can give 10.2.2.2/32 through 10.2.2.254/32 DHCP
Every module runs it's own DHCP server.
Now the problem is that when a module gets a request from another module to assign it an ip address, DHCP server should respond; but the problem is DHCP can't assign ip addresses in the fashion that I have described and I can seem to only set it up for contiguous ip-blocks .
example 192.168.1.0 to 192.168.254.254 is OK but I need 192.168.1.0 to 192.168.254.0
Is there any way to make a DHCP server assign IP addresses the way I want it to?