Menu

DHCP

What is DHCP?

DHCP (Dynamic Host Configuration Protocol) is a protocol used to assign an IP address, domain name and other configuration information to computers on a network. DHCP is usually enabled on routers and other devices that are connected to the Internet. When a computer connects to the network, it broadcasts a request for an IP address and other configuration information from the DHCP server. The DHCP server then allocates an IP address, domain name and other configuration information to the computer. DHCP is an important protocol for network administrators and users because it allows computers to automatically obtain their IP addresses. However, this feature can also be a security risk. If the DHCP server is not configured properly, it may be possible to obtain unauthorized or incorrect information from the server.

According to Microsoft they define it as a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway.

Dynamic Host Configuration Protocol

a protocol for delivering host-specific configuration parameters from a DHCP server to a host and a mechanism for allocation of network addresses to hosts.

Definitions

  • DHCP server: The DHCP server is responsible for assigning IP addresses to devices on the network.
  • DHCP client: The DHCP client is the device that requests an IP address from the DHCP server.
  • Lease time: The lease time is the amount of time that a DHCP lease is valid for.
  • Renewal: The renewal process is used to extend a DHCP lease when it expires.
  • Rebinding: Rebinding is used to reassign a DHCP lease to a new device.
  • Release: The release process is used to terminate a DHCP lease.
  • Static IP addresses: Static IP addresses are assigned manually

Purpose of DHCP

  • allow hosts to dynamically learn their network configurations such as IP, DNS, Mask, Default gateway, etc
  • modern networks used it
  • home networks usually the DHCP role is performed by the router it self
  • meant for client devices such as laptops, phones, etc. to obtain unique IP addresses
  • not meant for servers, printers, routers, firewalls and switches because they need manual configuration such as static IP
  • Corporate networks run a DHCP server such Windows Server or a Linux box

Functions of DHCP

Try to understand the DHCP process called DORA to know how DHCP function.

ipconfig /all #Display IP Configurations
  • Network Adapter configurations
  • Obtain an IP address automatically
  • Obtain DNS server address automatically
  • DHCP servers uses UDP 67
  • DHCP clients uses UDP 68
Caption: Laptop connected to Wi-Fi after issuing a ipconfig /all

DORA

DORA is the process that is used by DHCP. It helps in providing unique IP addresses to clients or hosts on the network. The process goes through 4 steps below.

  1. Discover
  2. Offer
  3. Request
  4. Acknowledge

Commands to initiate the DORA process. If we use packet capture tools like wireshark we can see how the process works in detail.

In summary, here is what going to happen from the above command.

  • Are there any DHCP servers on the network? I need an IP address.
  • How about this IP address?
  • I want to use the IP address you offered me
  • Okay, you may use it
DiscoverClient -> ServerBroadcast
OfferServer -> ClientBroadcast or Unicast
RequestClient -> ServerBroadcast
AckServer -> ClientBroadcast or Unicast
ReleaseClient -> ServerUnicast
Table showing DORA process

DHCP Relay

We configure a DHCP relay when the router is not the DHCP server, and DHCP clients connected to the router’s connected LAN. And there is no DCHP server in the connected LAN either.

  • Configure Router to act as DHCP server for its connected LAN
  • Router must be configured as DHCP relay agent if DHCP server is centralized
  • It will forward the DHCP request to the server as uni-cast

Routers do not forward broadcast messages

This the reason why we configure DHCP relay.

Benefits of DHCP

  • Reliable IP address configuration
  • Minimizes configuration errors caused by manual configurations
  • Avoid IP address conflicts
  • Reduced network administration

Configuring DHCP on Cisco IOS

Source: Jeremy IT lab

Steps to configure a DHCP server in IOS

  1. Specify a range of address that won’t be given to DHCP clients
  2. Create a DHCP pool
  3. Specify subnet of addresses to be assigned to clients
  4. Specify DNS server that DHCP clients should use
  5. Specify the domain name of the network
  6. Specify the default gateway
  7. Specify the lease time

Router IOS Commands

Commands used for configuring the router R1.

DHCP Relay Agent Configuration in IOS

Steps to configure DHCP Relay agent:

  1. Configure the interface connected to the subnet of the client devices
  2. Configure the IP address of the DHCP server as the ‘helper’ address

DHCP Client Configuration in IOS

wanikwai
wanikwai

A christian & dad to Mireya and Jnr. I write occasionally about technology on this website.

Articles: 25

Share your thoughts

Discover more from Watson Anikwai

Subscribe now to keep reading and get access to the full archive.

Continue reading