Module 5.1 55 minIntermediate

DHCP — server, relay, and client

DHCP gives every host an IP, mask, gateway, and DNS without anyone touching the keyboard. This chapter walks through the DORA exchange, configures a router as a DHCP server, and explains the ip helper-address relay.

Course plan — preview

What you'll learn

  • List the four DHCP messages in order: Discover, Offer, Request, Acknowledge.
  • Configure a DHCP pool on a router.
  • Explain when ip helper-address is required.

The DORA exchange

All four are sent inside UDP. The client's source IP is 0.0.0.0 until the lease is granted; broadcast destination 255.255.255.255 is used for Discover and Request.

What the client ends up with is a lease: an address and a mask, a default gateway, one or more DNS servers, and a time limit. The rest of this chapter follows those four messages in detail — who hears each one, how a server picks the address, how a router relays them, and what to check when a host ends up with no address at all.

  • Discover — client broadcasts 'I need an address' (UDP 67).
  • Offer — server replies with a candidate lease (UDP 68).
  • Request — client formally requests the offered address.
  • Acknowledge — server confirms the lease.

Configure a router as DHCP server

Read the configuration top to bottom. The exclusion keeps the router's own address and the hand-configured devices out of the pool. The network line sets the subnet and the mask the clients receive. default-router and dns-server fill in the gateway and the resolvers, and lease sets how long a client may keep its address, in days. The two show commands list the pool and the leases it has handed out.

R1(config)# ip dhcp excluded-address 10.0.10.1 10.0.10.20
R1(config)# ip dhcp pool LAN10
R1(dhcp-config)# network 10.0.10.0 /24
R1(dhcp-config)# default-router 10.0.10.1
R1(dhcp-config)# dns-server 10.0.99.53 10.0.99.54
R1(dhcp-config)# lease 3
R1(dhcp-config)# end
R1# show ip dhcp pool
R1# show ip dhcp binding

10 more sections in this chapter, plus a 4-question quiz and a hands-on lab.

Course plan

Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account

You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.

  • Read every chapter in Module 1 — How Networks Work
  • Save labs of up to 5 devices
  • Save up to 3 topologies
  • See the full course syllabus + chapter titles

Free account · no card required · compare plans any time

Build it step by step