0:00–0:10
Recap
0:10–1:50
Lab 3B
1:50–2:00
Debrief
0:00 – 0:10Recap · 10 min
Verify DHCP is working and introduce the error lab
- Check: S1's isc-dhcp-server running? dhcpd.log showing events? Ask: "The DORA process — which two steps use broadcast? Why can't the client unicast the Discover directly to the server?" — it doesn't know the server's IP yet. That's exactly why broadcast is necessary.
- Today's lab teaches error diagnosis by introducing deliberate config mistakes. The goal is to read the error output from the daemon and trace it back to the specific problem. This is how real troubleshooting works: you read the log, not guess at the cause.
0:10 – 1:50Lab 3B · 100 min
Lab 3B — Error diagnosis, DORA tcpdump capture, MAC-based reservation
Part 1 — Deliberate configuration errors (35 min)
- Introduce each error below one at a time. After each error: restart the daemon, check the journal for the error message, record what the message says, then fix it before introducing the next. The pattern to learn: the error message always includes the file and line number.
- Error 1 — Missing semicolon: Remove the semicolon after
option routers 192.168.50.1. Restart. Record the exact journal error message. Fix and restart. Expected: "parse error at /etc/dhcp/dhcpd.conf line X near 'option'"
- Error 2 — Invalid range: Change the range to
range 10.14.6.45 192.168.50.125; (a range spanning two different networks). Restart. Record the error. Expected: the daemon will refuse to start because the first address is not in the declared subnet.
- Error 3 — Missing subnet declaration: Remove the entire subnet block (keep the global options). Restart. Record the error. Expected: the server starts but complains about not being configured to serve any subnets on eth1.
- Restore the working dhcpd.conf after each error is documented. Final state must be a fully functional configuration.
Part 2 — DORA capture with tcpdump (25 min)
- On S1, start a capture on the LAN1 interface filtering DHCP traffic:
sudo tcpdump -i eth1 -n -v port 67 or port 68
- Switch S2's Netplan back to DHCP (dhcp4: true, remove static config). Apply:
sudo netplan apply. Watch the four DORA packets appear in the capture on S1.
- In the capture output, identify and label each packet:
· DHCPDISCOVER — source 0.0.0.0, destination 255.255.255.255
· DHCPOFFER — source S1, destination 255.255.255.255 (or unicast to S2's MAC)
· DHCPREQUEST — source 0.0.0.0 (or newly offered IP), destination 255.255.255.255
· DHCPACK — source S1, destination assigned IP
- Record the tcpdump command and a sample of the output in the lab sheet. Answer: are any DORA steps unicast? Which ones and why?
Part 3 — MAC-based reservation (30 min)
- Find S2's MAC address: on S2, run
ip link show eth0. Record the MAC address exactly (format: xx:xx:xx:xx:xx:xx).
- Add a host block to dhcpd.conf on S1. Add it inside the subnet block or globally — outside the subnet block also works:
host s2 {
hardware ethernet [S2-MAC];
fixed-address 192.168.50.2;
}
The fixed-address must be within the declared subnet but does not need to be inside the range — reservations are separate from the pool.
- Restart isc-dhcp-server. On S2, release and renew the lease:
sudo dhclient -r eth0 && sudo dhclient eth0
Verify S2 now receives 192.168.50.2 instead of a pool address.
- Check the lease database:
cat /var/lib/dhcp/dhcpd.leases. Find S2's entry — it should show the reserved address. Note the structure: binding state, lease expiry, MAC address, client hostname.
Part 4 — Restore S2 static IP (10 min)
- Before ending the session, restore S2 to a static IP. The DNS labs (3C and 3D) need a predictable address for zone file records:
Edit S2's Netplan back to: dhcp4: false, addresses: [192.168.50.2/24], gateway: 192.168.50.1. Apply: sudo netplan apply.
- Verify S2 is reachable from S1:
ping 192.168.50.2. The DHCP reservation is still in dhcpd.conf — if S2 is ever put back on DHCP, it will still receive .2.
Lab 3B complete when: All three deliberate errors documented with exact error messages. DORA exchange captured with tcpdump and all four packet types identified. MAC reservation for S2 configured and verified to assign 192.168.50.2. S2 restored to static IP. Lease database entry for S2 recorded.
1:50 – 2:00Debrief · 10 min
- Ask: "Can you have two DHCP servers on the same network segment? What happens?" — both respond to DHCPDISCOVER. The client takes the first DHCPOFFER it receives — typically whichever server is faster. If the two servers have overlapping ranges, both may offer the same address, leading to IP conflicts. In practice, you want exactly one authoritative DHCP server per segment (or per VLAN).
- Ask: "Can S1 serve DHCP to a different network — say, give out addresses on 10.0.0.0/24 if S1 is on 192.168.50.0/24?" — no, not without a relay agent. DHCP Discover is a broadcast; it doesn't cross routers. A DHCP relay (dhcp-helper) running on the router would forward the broadcast to a specific DHCP server. This is how large enterprises use a central DHCP server for many subnets.
- Preview Wednesday: DNS. The domain name option we added to dhcpd.conf (
option domain-name "yourname.net") currently points to a zone that doesn't exist. Wednesday we build it.
Learning outcomes — by end of Day 2, students can…
Diagnose dhcpd.conf errorsRead the journal output from isc-dhcp-server, identify the error type and line number, and correct it
Capture and identify DORA packetsUse tcpdump on UDP 67/68, identify each DORA step in the output, and explain why Discover and Request use broadcast
Create a MAC-based reservationWrite a host block in dhcpd.conf with hardware ethernet and fixed-address, and verify the client receives the reserved IP
Read the DHCP lease databaseInterpret the fields in a dhcpd.leases entry including binding state, MAC, IP, and expiry times
Common issues and fixes
| Issue | Likely cause | Fix |
| S2 doesn't get the reserved IP after adding host block | MAC address entered incorrectly (wrong format or typo), or lease not renewed after config change | Verify MAC exactly with ip link show eth0 on S2. Force release/renew: sudo dhclient -r eth0 && sudo dhclient eth0. Check dhcpd.log for the reservation matching |
| tcpdump shows no DHCP packets | Wrong interface — DHCP traffic is on eth1 (LAN1), not eth0 (External) | Confirm with: sudo tcpdump -i eth1 -n port 67 or port 68. S2's DHCP traffic never reaches eth0 |