Skip to main content

DHCP

Updated May 25, 2020 ·

Overview

Dynamic Host Configuration Protocol (DHCP) automatically gives hosts the network settings they need to communicate. Without DHCP, administrators would need to manually configure IP addresses, subnet masks, default gateways, DNS servers, and other options on each device.

What DHCP Provides

DHCP can provide:

  • An IP address.
  • A subnet mask or prefix length.
  • A default gateway.
  • DNS server addresses.
  • Other vendor or platform options.

Cisco wireless access points, for example, can use DHCP option 43 to learn the Wireless LAN Controller address they should connect to.

Allocation Methods

MethodDescription
AutomaticThe DHCP server assigns a permanent address to a client.
DynamicThe DHCP server leases an address for a limited time.
ManualAn administrator maps a client to an address and DHCP delivers it.

DHCP Relay

DHCP uses broadcast messages at the beginning of the lease process. If the client and server are on different subnets, a DHCP relay agent forwards DHCP messages between them.

DHCP uses these ports:

DirectionPort
Client to server67
Server to client68

DHCP Operation

The classic DHCP process is often remembered as DORA:

StepMessagePurpose
DiscoverDHCPDISCOVERClient looks for available DHCP servers.
OfferDHCPOFFERServer offers an address and lease details.
RequestDHCPREQUESTClient requests one offered lease.
AckDHCPACKServer confirms the lease.

If the selected offer is no longer valid, the server sends a DHCPNAK and the client starts again.

DHCPv6

DHCPv6 has a similar purpose, but IPv6 clients can also use Router Advertisement messages and Stateless Address Autoconfiguration. DHCPv6 messages include SOLICIT, ADVERTISE, INFORMATION REQUEST, and REPLY.