DHCP Server Configuration in windows 2016

DHCP stands for Dynamic host configuration protocol. DHCP provides Automatic IP address, gateway, DNS server ip address for network devices (computer, Mobiles, Printers , IP phones etc) from a specified range of IP addresses. DHCP Server uses port 67 and DHCP Client use port 68 for communicating with each other.

In windows 2016 DHCP is Role service which is required to add and configured for IP address assigning. After adding of DHCP roles, Before installing of DHCP server role, User must be logged in with local admin or domain administrator. It can be managed with graphical DHCP management console or Powershell Console.

How DHCP Works:-

In most home, the router acts as the DHCP server. In large networks, a windows/Linux Server might act as the DHCP server. DHCP Works on process which is called DORA:

D: Discover, O=Offer, R=Request, A=Ack,

Once a device(Computer) is turned on and connected to a network that has a DHCP server, it will send a request to the server, called a DHCPDISCOVER request. This Request is broadcast type of message which is sent over network.

once the DHCPDISCOVER packet reaches the DHCP server, the server attempts to hold on to an IP address by that the device can use, and then offers the client the address with a DHCPOFFER packet.

Once the offer has been made for the chosen IP address, computer responds to the DHCP server with a DHCPREQUEST packet to accept it, after which the server sends an ACK that's used to confirm that the device has that specific IP address and to define the amount of time that the device can use the address before getting a new one.

__ DHCP Terminology:__

SCOPE: A range of IP address which will be used by DHCP server to assigning the IP address to the client machines.

Scope Options: Scope options can be used to integerte other address(DNS, Gateway, Domain Name ) which can be assigned during IP leases.

Reservation: Binding a specific IP address using MAC address for a specfic IP address.

Exclusions: Prohibiting a specfic IP address or range of ip addresses within scope range for dhcp clients so excluded IP address will not be offered by dhcp server.

Address Leases : Address leases maintain a list of IP address which is offered with host name and mac address. 7. DHCP Filters: Filters is a usefull security feature which can block the systems mac address, So systems will e prohibited to get the DHCP Offer from DHCP server.

DHCP Server by Powershell command Install-WindowsFeature DHCP -IncludeManagementTools

add the DHCP server to the list of authorized DHCP servers in Active Directory.

Add-DhcpServerInDC -DnsName DHCP1.testlab.com -IPAddress

To verify that the DHCP server is authorized in Active Directory, you can use the following command.+ Get-DhcpServerInDC

Add-DhcpServerv4Scope -name "SCOPE_1" -StartRange -EndRange -SubnetMask -State Active`

Run this command If you want to exclude the Range of IP address only

Add-DhcpServerv4ExclusionRange -ScopeID -StartRange -EndRange`

Set-DhcpServerv4OptionValue -OptionID 3 -Value -ScopeID -ComputerName DHCP1.testlab.com`

Set-DhcpServerv4OptionValue -DnsDomain testlab.com -DnsServer

DHCP Failover: DHCP failover provides high availability by synchronizing IP leases or other information with other DHCP server, It can also provides the load balancing feature.