Introduction
DHCP gives clients addresses and network parameters. Reliable configuration requires a correct subnet declaration, non-overlapping pools, reservations, authoritative behavior, and relay support across routed networks.
What you should be able to do after this lesson:
- Configure a subnet and dynamic range.
- Provide gateway, DNS, and lease options.
- Create fixed-address reservations.
- Inspect leases and logs.
- Explain a DHCP relay.
- Distinguish DHCPv6 from IPv6 Router Advertisements.
Big Idea: The Server Chooses a Scope from the Client's Link
For a directly connected client, the receiving server interface identifies the subnet. Across a router, relay information identifies it. If the server cannot map the request to a declared subnet, a perfectly valid address pool may never be considered.
DHCPv4 Exchange
A new client typically follows DORA:
- Discover
- Offer
- Request
- Acknowledge
The initial messages are broadcasts because the client does not yet have a usable address.
Basic Server Configuration
A common ISC DHCP configuration uses /etc/dhcp/dhcpd.conf:
authoritative;
default-lease-time 3600;
max-lease-time 86400;
subnet 192.0.2.0 netmask 255.255.255.0 {
range 192.0.2.100 192.0.2.199;
option routers 192.0.2.1;
option domain-name-servers 192.0.2.53;
option domain-name "example.test";
}
The server interface must have an address in a declared subnet or be configured for relay-based service.
Reservations
host printer01 {
hardware ethernet 02:00:00:00:00:25;
fixed-address 192.0.2.25;
}
Keep fixed addresses outside dynamic ranges unless the implementation safely coordinates them.
Leases and Validation
Lease state is commonly stored in dhcpd.leases. Do not edit active lease data casually.
dhcpd -t -cf /etc/dhcp/dhcpd.conf
journalctl -u dhcpd
Packet capture can verify exchange direction:
tcpdump -ni eth0 'port 67 or port 68'
DHCP Relay
Broadcasts normally do not cross routers. A relay receives client broadcasts and forwards them to a remote DHCP server while identifying the originating subnet. The server chooses a matching pool based on relay information.
BOOTP Awareness
DHCP extends concepts from BOOTP and can support boot parameters such as a next server and boot filename, often used for network installation. A host declaration can provide per-client options for a static address or boot workflow rather than relying only on subnet defaults.
IPv6
IPv6 Router Advertisements announce prefixes, default-router information, and flags. DHCPv6 can provide addresses or additional options, but a DHCPv6 server does not provide the IPv6 default route in the same way DHCPv4 does. radvd is one daemon that sends RAs, commonly configured through /etc/radvd.conf.
Guided Practice: Trace DORA
On an isolated DHCP lab network, validate the configuration first:
dhcpd -t -cf /etc/dhcp/dhcpd.conf
journalctl -u dhcpd --since '-5 minutes'
Capture one client renewal:
sudo tcpdump -ni <lab-interface> -vv 'port 67 or port 68'
Identify Discover, Offer, Request, and Acknowledge messages. Compare offered address, subnet mask, router, DNS server, lease time, client MAC address, and server identifier with dhcpd.conf and dhcpd.leases.
Add a reservation outside the dynamic pool and verify that the intended client receives it. If testing a relay, capture on both sides and identify the relay address used by the server to select a subnet.
Troubleshooting Scenario
Clients on the server's local subnet receive leases, but clients behind a router receive no offers. The remote pool exists and the server is healthy; no relay is configured on the router.
Configure the relay toward the DHCP server, permit the required UDP path, and verify that relay information identifies the remote subnet. Expanding the local dynamic range would not carry broadcasts across the routed boundary.
Exam Focus
- Know
dhcpd.conf,dhcpd.leases,dhcpd, log locations, and ARP verification. - Configure subnet pools, defaults, per-client reservations, and BOOTP-style boot options.
- Understand why a relay is required across routers.
- Distinguish DHCPv6 options from IPv6 Router Advertisements and
radvd.conf.
Recap
- Pools, reservations, and subnet declarations must agree.
- Validate configuration before restart or reload.
- Relays carry DHCP across routed boundaries.
- IPv6 addressing may combine Router Advertisements and DHCPv6.
Test Your Knowledge
Complete the quiz to assess your understanding of this course's concepts.
