3

Which server's IP address is selected if the client receives the Offer from 2 DHCP servers (on different subnet) at a time?

I searched Google and the answer I got is: which Offer comes first will be selected by the client.

But my doubt is: what if the Offers from the 2 DHCP servers arrive at same time?

brasofilo
  • 235
user3017432
  • 31
  • 1
  • 2

2 Answers2

4

If you have two network cards in your PC, then both will have different network settings and get different IPs from different DHCP servers.

On each network card all packets will arrive serialized. The OS will not see two packets at the same time, the packets will be in an order.

So the problem you describe will not arise.

As you wrote in a comment a client does not need to accept the first DHCP answer, the client is free to wait for multiple answers and select one configuration (RFC 2131, section 3.1.3). What could be criteria to select one configuration? Section 4.4.1 gives two: "e.g., the first DHCPOFFER message or the DHCPOFFER message from the previously used server". Other criteria might be based on the DHCP options (RFC 1533). A client might prefer an answer with Router Option, Time Server Option, Name Server Option, Domain Name Server Option or LPR Server Option over an answer without these options. It might also prefer offers with a special Domain Name or depending on the IP address/network offered.

I do not know a good reason to have multiple DHCP servers in a network despite for redundancy. And for this both DHCP servers should be configured identically except for a different range of IPs (in the same subnet) they offer.

Werner Henze
  • 4,977
1

DHCP Client can be configured to request and require certain parameters (dhcp-options) from DHCP Server. Refer link. these parameters are specified in dhcpclient.conf