IP conflict detection by DHCP server

Hi All

Hope this post finds you in good health and spirit. Today we are going to discuss IP address conflict detection by DHCP server and process to configure it.

Two machines should not have same address within network and it can lead to address conflict. To solve this problem DHCP has built-in mechanism that enables client to ping IP assigned to it. If client is able to ping IP, it will assume that IP is present in network and is being used by other machine hence it will not accept IP and will send “Decline” message to server. Server will mark that IP address as bad IP, will put record in database and lease new IP to client. Let’s summarize the process:

  1. Client ping proposed IP and send decline message if it is in use.
  2. Server mark IP as bad and will make its entry in database.
  3. New IP is leased to client.

As you see this whole process is multi-step so can take lot of time. To speed up the process of conflict detection, its responsibility can be assigned to server. Once server is assigned with this responsibility, its work process is same as client. Server will ping the IP and will only assign IP to client if it will not receive any response from network.
When conflict detection is configured on server, there is a setting to specify how many ping packets will be sent in network before assigning IP to client. Best practice is to keep this number not more than 2 as more number of packets can delay the process. To configure this setting you can use GUI or command line. Steps to configure conflict detection is as under:

By GUI

  1. Open DHCP console.
  2. In the console tree, expand console and click on IPv4.
  3. On the Action menu, click Properties.
  4. Click the Advanced tab.
  5. For Conflict detection attempts, type a number and then click OK.

By Command prompt

Netsh DHCP Server set detectconflictretry <no of attempts>
To confirm entry you can use
Netsh DHCP Server show detectconflictretry
Wasn’t it straightforward?

So that’s all in this blog. I will see you soon with some other technical stuff. Till then take good care of yourself and I will go out to enjoy my “Sunday”. Bye.

DHCP client behavior during restart if DHCP server is down

Hello Friends

I hope this post finds you in good health and spirit. Recently I was doing some R & D on DHCP and found some interesting facts about DHCP client during restart. So putting them together in this post for future references. Probably you will also find this interesting.

So here the fact

Question: If DHCP client have got IP from DHCP server and enough time is left before lease expire, what will happen if client restarts and the server is unavailable?

Answer: If client is not able to reach server at time of startup, it tries to ping default gateway that was assigned previously. If default gateway responds that client assumes that it is still in same network and hence keeps on using IP address (Remember lease time is still left). If client can’t get response from gateway, it will consider itself to be out of network and hence will auto configure (put APIPA address) itself. Meanwhile, client will keep on searching for DHCP server every 5 mins and once it receive response from server, will abandon APIPA and will get new IP from server.

I did testing to verify above mentioned facts and YES it works like that. Since it’s new and interesting information for me so thought to post it here before losing. Was this new for you too? Asking out of curiosity please don’t get offended. Lol.

“By the way today Pakistan has finally decided that will send their cricket team to India for T-20 world cup. Wow, at-last. Now it’s going to be a good contest”.

Thanks for your time and I will see you soon with another post. Till then “Bye” and take good care of yourself.