Powered by Blogger.

DHCP : Dynamic Host Configuration Protocol



One of the many services that we mostly need in our network is DHCP. The Dynamic Host Configuration Protocol is used to dynamically assigned IP addresses and Default gateway information to the host on a network. In simple words, the DHCP functionality can be expressed as:


As can be seen, our host is acting as a DHCP client on the LAN, it will send DHCP Discover broadcast on the network, and all the relevant data will be provided like IP Address, Subnet Mask, Default Router, DNS Server, to the requesting host. DHCP discovery is a 4 leg process:

  • Discover
  • Offer
  • Request
  • Acknowledge
The client send a Discover message, the DHCP server send a Unicast Offer, the client then sends officially a Request Offer, and an ACK send by DHCP server. It seems ambiguous? Better explained by below diagram:


CISCO IOS can also be configured as a DHCP server and Client. A router can be configured as a

  • DHCP Server
  • DHCP Client
  • DHCP Proxy


Quick Facts about DHCP:

  • UDP 67 is server-side port
  • UDP 68 is client-side port


Redundancy can be created via DHCP safe fail over Protocol using a cluster of DHCP servers in which one server acts as a Primary Server and the second one act as Backup Server on which Backup address pool is configured which could be used in case of failover of the primary DHCP server. So far we have discussed the basic working of DHCP, its packet flow, and how to enable redundancy in DHCP. Now it is time to move into configuration.

Configuration:

We are going to configure DHCP in packet tracer. We have bunch of host connected to a switch, which is connected to a router. The router is acting as DHCP server and all the hosts in the network are assigned IP addresses from our defined IP pool for DHCP. The topology we will be using is as follow:




In the above network, we have enabled Routers0 interface as our DHCP and DNS server. The client are not configured with static IP, instead DHCP option is selected on each host, to get all configuration data from the DHCP server. Once the router is up and Clients are active, the client instantly updates their IP addresses and Default gateways by sending DHCP requests. We have configured a DHCP pool by name of LOCAL_LAN pool on our router; the IP addresses assigned to the hosts are leased from this IP pool. We have also mentioned some of the address which should not be assigned by the DHCP server, using
ip dhcp excluded-address , command as these addresses are already assigned or kept for future use.

The DHCP configurations done on R0 are:


The default router and dns server address is our routers Fast Ethernet 0/0 interface IP address. We have excluded the DHCP server IP and DNS IP from the list of IPs that is going to be assigned by DHCP server. To define router as proxy DHCP server, we use ip helper command under interface config mode, this just relay all DHCP requests to the mentioned DHCP server. Last thing, in dhcp options, we can also define lease time, the time duration till which the address is valid. The address will be renewed after the lease time is elapsed. 



I hope you enjoyed this article. Please do let me know your feedback and comments. 

0 comments:

Post a Comment