Skip to main content

Can a dhcp client select its server? How? [Resolved]

We have a bunch of IOT gadgets which will share cabling with a customer's regular LAN. We would like them to be logically separate. Let's say the regular LAN uses 198.162.x.x, and we want to use 10.10.x.x. There will be enough of these gadgets that using static addresses for them is not practical. They will not need to communicate with any of the customer's equipment by way of the LAN but are completely independent in that regard.

The LAN itself (cabling, switches, etc) is not our hardware - we don't administer it and don't want to complicate the existing useage by the people who do. We cannot expect to use VLANS, or that the existing switches will support that, and we can't add additional hardware such as relays. We just want to piggy-back on the existing cabling infrastucture. The regular LAN will be Windows workstations, our devices will be running some flavor of GNU/Linux.

What I have read so far about multiple dhcp servers on the same LAN is either a) "Don't do it, this is an error", or b) "Yes, this is fine if they are cooperating and load sharing and and on the same logical network, and if it does not matter from which server a client gets its address".

It appears that dhcp clients may use a number of options, including user-defined ones. Is there a way to set up a dchp server (our hardware) and dhcp clients (also our hardware) so that the clients will only accept address offers from our dhcp server and reject or ignore offers from any other dhcp server?

Specifically, is there a way for a dhcp client to recognize and act on "option dhcp-server-identifier"? It seems to me that this should be possible but I have not found any examples or discussion of this.


Question Credit: mickeyf
Question Reference
Asked October 9, 2019
Posted Under: Unix Linux
12 views
1 Answers

Yes, technically this is possible: your DHCP server can define new options, and your DHCP clients can be set up to refuse offers which don’t include those options (see the require statement in dhclient.conf, for ISC’s client).

However this is a bad idea, because you don’t control all the DHCP servers and clients on the network. The default DHCP server may not cause problems for your clients, but you won’t be able to prevent your own DHCP server from answering other clients’ requests, and giving the existing network hosts addresses which won’t work for them...


credit: Stephen Kitt
Answered October 9, 2019
Your Answer