Peters School of Business · Assiniboine College · NETW-0014
2 hours · Lecture + Lab 3A · DORA, isc-dhcp-server, dhcpd.conf, DHCP logging
The DORA process, DHCP lease lifecycle, and dhcpd.conf structure
Part 1 — Why DHCP? (5 min)
Part 2 — The DORA process (12 min)
Part 3 — dhcpd.conf structure (10 min)
/etc/default/isc-dhcp-server — specifies which interfaces the daemon listens on. Critical: only bind to internal interfaces. If eth0 (External) is listed, the server broadcasts DHCP offers onto the classroom network. /etc/dhcp/dhcpd.conf — the actual scope and option configuration.authoritative; — declares this server as the authoritative DHCP server for the subnets it manages. Without this, it will not send DHCPNAK to clients with incorrect addresses.
default-lease-time — lease duration offered if the client doesn't request a specific time (in seconds).
max-lease-time — maximum lease a client can request.
subnet ... netmask ... { range ...; option routers ...; option domain-name-servers ...; } — the scope block. Semicolons are mandatory after every option — one missing semicolon stops the daemon cold.
Part 4 — DHCP logging (3 min)
log-facility local0; to dhcpd.conf. Then a rsyslog rule routes local0.* to /var/log/dhcpd.log. This is a direct application of the rsyslog skills from Week 2.Lab 3A — Install and configure isc-dhcp-server, DHCP logging, verify S2 lease
Part 1 — Install isc-dhcp-server (15 min)
sudo apt install isc-dhcp-server. Check status immediately: sudo systemctl status isc-dhcp-server. It will show failed — this is expected. Read the error carefully: it says it is "not configured to listen on any interfaces." This is the most important lesson of the install: the package installs but doesn't run until we configure it.sudo systemctl is-enabled isc-dhcp-server. Note the result — students record this in the lab sheet.Part 2 — Configure the listening interface (10 min)
/etc/default/isc-dhcp-server. Find the line INTERFACESv4="" and add the LAN1 interface: INTERFACESv4="eth1". Use S1's actual LAN1 interface name — confirm with ip link show first. Do not add the External interface (eth0) — that would broadcast DHCP onto the classroom network.Part 3 — Configure dhcpd.conf (25 min)
sudo mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.original. Create a clean new file: sudo nano /etc/dhcp/dhcpd.conf.authoritative;
log-facility local0;
default-lease-time 86400; # 1 day in seconds
max-lease-time 604800; # 1 week in seconds
subnet 192.168.50.0 netmask 255.255.255.0 {
range 192.168.50.10 192.168.50.110;
option routers 192.168.50.1;
option domain-name-servers 172.17.0.1, 1.1.1.1;
option domain-name "yourname.net";
}
sudo systemctl start isc-dhcp-server. If it fails, check the journal: sudo journalctl -u isc-dhcp-server -n 20. Read the error — it will point to the specific line with the problem.Part 4 — Configure DHCP-specific logging (15 min)
log-facility local0; directive in dhcpd.conf makes DHCP events use the local0 syslog facility. Now add an rsyslog rule to route those events to a dedicated file. Edit /etc/rsyslog.d/50-default.conf on S1 and add:
local0.* /var/log/dhcpd.log
sudo touch /var/log/dhcpd.log
sudo chown syslog:adm /var/log/dhcpd.log
sudo systemctl restart rsyslog
sudo tail -f /var/log/dhcpd.log. The server startup events should appear there rather than in syslog.Part 5 — Verify S2 lease (15 min)
dhcp4: true (remove the static address and gateway lines).
sudo netplan apply.
sudo tail -f /var/log/dhcpd.log. Within a few seconds you should see the DORA exchange: DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK. Record the severity and facility that appear in the log for each event.ip addr show eth0. It should be in the 192.168.50.10–110 range. Also check: ip route show — the default gateway should be 192.168.50.1 (S1). Try pinging 8.8.8.8 — internet access should still work through S1's NAT.cat /var/lib/dhcp/dhcpd.leases. Record the structure of S2's lease entry — the MAC address, the assigned IP, the lease start and end times.sudo tcpdump -i eth1 -n port 67 or port 68. Release and renew S2's lease: on S2, run sudo dhclient -r eth0 then sudo dhclient eth0. Walk through the four packets together on the projector — identify each packet type by the DHCP option field in the verbose output.Learning outcomes — by end of Day 1, students can…
Common issues and fixes
| Issue | Likely cause | Fix |
|---|---|---|
| isc-dhcp-server fails to start after configuring interface | Syntax error in dhcpd.conf — most commonly a missing semicolon | Check journal: sudo journalctl -u isc-dhcp-server -n 30. The error message includes the file name and line number. Every line in dhcpd.conf must end with a semicolon except the closing braces |
| S2 doesn't get a lease after switching to DHCP | Wrong interface name in /etc/default/isc-dhcp-server, or firewall blocking UDP 67/68 | Verify interface name matches exactly: ip link show. Check UFW is not blocking DHCP ports. Check tcpdump on S1 — is S2's Discover arriving? |
| DHCP log entries appear in syslog instead of dhcpd.log | log-facility local0 not in dhcpd.conf, or rsyslog rule not added / rsyslog not restarted | Verify dhcpd.conf contains log-facility local0;. Check 50-default.conf has local0.* /var/log/dhcpd.log. Restart both services |
| dhcpd.leases file is empty | No leases have been issued yet | The file exists but starts empty. It populates as leases are granted. Trigger a lease by running dhclient on S2 |