Thursday, 30 April 2015

IP reservation with DHCP

How DHCP works:



As soon as DHCP client connect to the network it send a broadcast message to its subnet called as DHCP discover message to indicate to the DHCP servers there is a host that would like to get an IP address. The DHCP server in the subnet then replies to that message with a DHCP offer. DHCP offer includes IP address and associated configuration information. Then if DHCP client is ready to accept the offer, it send DHCP Request message to the corresponding DHCP server. Then DHCP server send DHCP acknowledge message to the DHCP client approving the lease along with the info such as default gateway, DNS server addresses, WINS server addresses. After client receive ack message it will completes the initialization of the IP address.


There are situations where some pc, servers should have fixed ip always. One way to do is assign static ip to those devices. But since DHCP intend to go away from static mappings there is way we can reserve a IP address for a device using DHCP config. So when the particular computer or device request IP from DHCP server it will check with its IP reservation rules and issue the IP address define on the rule. So always this particular machine will get the same IP address.

This reservation is doing based on the MAC address which used by the computer which needs permanent ip. MAC is unique address so it wants make any conflict with any other computer in the network.

In the demo I will explain how to do a reservation and how it’s working.


  • As first step need find the MAC address of the client pc which needs a reservation. To find it log in to the computer and open command prompt > type ipconfig /all. In their it shows the MAC as below. Before do this make sure the PC is set to DHCP as described in previous section.



  • Now need to log in to the server where DHCP configured. Then open the DHCP console > expand IPV4 > expand the Scope required the config.


  • Then right click on reservation and select option “New reservation”
  • In next window can define the ip address which will be map to this reservation, the MAC address of the client pc and description. Also can select if its BOOTP reservation or DHCP reservation. In here I choose both. Once done click ok “add” to complete the reservation.


Then need to go back to client PC and type following commands in CMD

•    Ifconfig /release – This is to release the DHCP address it had
•    Ifconfig /renew – This is to get new ip from the DHCP server

Then it shows it’s got the IP address as set in the reservation.
  • In the DHCP server reservation section also will show it as the reservation is active.

No comments:

Post a Comment