What is DHCP
Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables a server to automatically assign an IP address to a computer from a defined range of numbers (i.e., a scope) configured for a given network. The DHCP server can provide easily IP addresses to clients automatically so you don’t even need to configure and set options in the client side, all you need is to setup DHCP server, configure scope options and some other TCP/IP settings in the server side and that’s it. You can provide to your clients IP addresses from the selected range that you’ve configured and some other TCP/IP options.
DHCP allows you to manage the networks’ IP addresses scopes and other TCP/IP settings like DNS, Default Gateway, etc. from central place, this central place called DHCP server. The DHCP works from central place, so if there’s a problem, it’s probably from the server, so you know where to go in case of problem and you’re saving time.
DHCP server works on port 67 on DHCP Server, and on port 68 at DHCP Client.
The Steps how a DHCP client request from the DHCP server for a IP address to be connected to the network it follow the rule (DORA). The specific time tenure the lease of IP Address provided by the DHCP Server to its clients.
The DHCP service works by using the DORA (Discover, Offer, Request and Acknowledgment)
- DHCPDISCOVER – The client boots up it broadcast a DHCPDISCOVER packet in order to locate a DHCP server in the network, in some cases that the DHCP server isn’t in the same subnet of the client, you’ll need to configure in your network devices (Routers, Layer3 Switch) a DHCP Relay Agent, in order to transfer the DHCPDISCOVER packet to the DHCP server.
- DHCPOFFER – The DHCP server broadcast a DHCPOFFER packet to the client which includes an offer to use a unique IP address for the client.
- DHCPREQUEST – The client broadcast a DHCPREQUEST packet to the DHCP server with an answer from the server to provide a address.
- DHCPACKNOWLEDGEMENT – The DHCP server broadcast a DHCPACKNOWLEDGEMENT packet to the client, and provide the IP address lease to the client and other details such as DNSservers, default gateway.
DHCP Scopes, Exclude and Reservation
DHCP Scope is a range of IP addresses that you configure in your DHCP server as range of addresses that designed for distribution to the clients.
You can also create more than one scope, At the scope creation process we can add more TCP/IP parameters such as subnet mask, IP addresses lease time, default gateway, DNS servers, etc. so when the clients gets the IP addresses they’ll get also the other parameters from the scope.
For exclusion of some IP Address range you can provide IP Address scope and exclude the DHCP to distribute the client.
There is a great feature In DHCP is Reservation we can specify a scope or a specific IP to a dedicated client that will be always assigned to that client and you can bind the MAC address with the IP.
When you’re installing DHCP server you can configure the DHCP server to set DNS updates to any DNS server that support dynamic updates. More information about the combination between DHCP and DNS you can find right here.
Active Directory & DHCP Servers
In Microsoft Windows Server 2000 Server/Server 2003/2008 with Active Directory you need to authorize your server in order to work with the DHCP service.
DHCP Relay Agent
DHCP Relay Agent is any kind of Device (Router,L3 Switch) that listen to DHCP/BOOTP broadcast from clients on subnets without local DHCP servers.
DHCP Relay Agent is needed to forward packet from the client to the DHCP Server on different Network