How does a client choose between two DHCP servers in the same network?
I read on netacad that there may be more than one DHCP servers in the same network and I was wondering, how does the client choose between them?
Does the client choose the one that sends the DHCPOFFER first or there is something else?
DHCP is first-come, first-serve. You should not have two competing DHCP servers on the same network without some form of fail-over or HA between them, otherwise you run the risk of having duplicate IP's on the same network.
You are correct, DHCP is first-to-answer as far as the client is concerned. This doesn't mean you can't (or shouldn't) have multiple DHCP servers for a given subnet; it just requires planning.
I prefer to use a primary and a secondary DHCP server with split scoping. The details of an example subnet:
- Subnet is 192.168.1.0/24
- The overall scope is configured to distribute 192.168.1.3 to .254
- Primary DHCP server is configured with 0ms delay in responding, and is set to exclude 192.168.1.201 to .254
- Secondary DHCP server is configured with 1000ms delay, excludes 192.168.1.3 to .200
For doing this with a Windows environment, this link discusses this in greater depth - https://blogs.technet.microsoft.com/teamdhcp/2009/01/22/how-to-configure-split-scope-using-wizard/