Linux course index · Linux Advanced category · Lesson 6 of 9
AI disclosure — AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.
Learning goal
Validate a Kea DHCPv4 pool and verify a lease issued to a VM on an isolated segment.
Concepts and setup
The original Ubuntu walkthrough uses the older ISC DHCP Server. This lab applies its server/client pattern to Kea. A DHCPv4 exchange typically goes Discover, Offer, Request, Acknowledge. A lease can carry an address, mask, router, DNS, and duration. Never start a DHCP lab on a shared or unauthorized network. A second server can cause unexpected and conflicting offers.
Give the server VM a static 192.168.56.20/24 address on an isolated adapter, and attach a disposable client VM to the same segment. Check the actual adapter names. Disable any separate hypervisor DHCP for that segment only. Keep a NAT adapter on a separate segment if it is needed.
Validate a small Kea configuration
# On the server VM, with kea-dhcp4-server installed:
lab=$(mktemp -d)
cat > "$lab/kea-dhcp4.conf" <<'EOF'
{
"Dhcp4": {
"interfaces-config": { "interfaces": [ "enp0s8" ] },
"valid-lifetime": 600,
"subnet4": [ {
"id": 1,
"subnet": "192.168.56.0/24",
"pools": [ { "pool": "192.168.56.100 - 192.168.56.130" } ]
} ]
}
}
EOF
sudo kea-dhcp4 -t "$lab/kea-dhcp4.conf"
printf 'configuration check status: %s\n' "$?"
Possible output
... DHCP4_CONFIG_COMPLETE ...
configuration check status: 0
A syntax check is not a lease test. In the disposable VM, back up the packaged configuration, then install the validated fixture at /etc/kea/kea-dhcp4.conf and restart kea-dhcp4-server. Continue only after confirming the bound interface is isolated.
Check the client lease against the server log
# Client VM: enable DHCPv4 on the isolated adapter in its network manager.
ip -4 -br address show dev enp0s8
ip route show dev enp0s8
# Server VM:
journalctl -b -u kea-dhcp4-server -n 25 --no-pager
Possible output
enp0s8 UP 192.168.56.100/24
192.168.56.0/24 proto kernel scope link src 192.168.56.100
... DHCP4_LEASE_ALLOC ... 192.168.56.100 ...
The allocated address can vary. No default router or DNS server is advertised by this fixture. Stop the service and restore the configuration on the server VM, or roll back the VM snapshot.
Questions only
Quick-check questions
- Why should a server’s static address be outside the dynamic pool?
- Does this isolated lease provide internet access?
Assessment questions
- How many addresses are in this inclusive pool?
- If the client receives .200 instead of .100–.130, what do you check?
- How would you prove your server issued the observed lease?
Questions and answers
Quick-check answers
- Why should a server’s static address be outside the dynamic pool?
Answer — An address must not be offered to a client if the server already uses it. - Does this isolated lease provide internet access?
Answer — No. This configuration advertises no gateway. A separate adapter could supply independent connectivity.
Assessment answer key
- How many addresses are in this inclusive pool?
Answer — 31, before exclusions or reservations. - If the client receives .200 instead of .100–.130, what do you check?
Answer — Check for another server and pre-existing leases, confirm the actual adapter, and verify the server’s configured pool. - How would you prove your server issued the observed lease?
Answer — Correlate the client lease and identity or timestamp with the server’s lease record or log.
Source articles on this site
- How to install a DHCP Server in Ubuntu:
- How to configure a DHCP Client in Ubuntu
- DHCP: How to configure a DHCP server in Linux #74
- Understanding Host-Only Networking in Oracle VirtualBox: Concepts, Tools, IP Addressing, DHCP, and Practical Options
Technical references
Continue the course
Previous lesson 05 — Authoritative DNS with BIND. Next lesson 07 — Time Synchronization with chrony.
Linux course index · Linux Advanced category · Lesson 6 of 9
