23 Dynamic Host Configuration Protocol: ISC Kea DHCP

Jacob Christensen

Dynamic Host Configuration Protocol (DHCP) is an interactive client-server protocol that automatically provides a host (PC, Laptop, Phone, etc.) with an IP address upon request. The purpose of this activity is for learners to see DHCP in action instead of just reading about the DHCP handshake theory. A secondary purpose is for learners to experience frustration when hosts do not get a DHCP IP address. Learners can see how packets move and where they may get hung up while working to make DHCP function correctly on their network. Finally, learners can see Address Resolution Protocol (ARP) in action. DHCP occurs when a host requests an IP address for an existing MAC address, while ARP occurs when a host has an IP address but is unsure which MAC address it belongs to.

Overview

The following steps set up the learning environment to better understand DHCP. Since learners have performed many of these tasks in other labs, we have taken liberties to reduce the number of steps and screenshots for repeated material. If you are confused about what you’ve been asked to do, please review the appropriate chapter of this book. By the end of this chapter, your network should look like the following:
kea dhcp lab gns3 network topology
Figure 1 – Network topology

Estimated time for completion: 60 minutes

Last updated September 2026

Learning objectives

  • Successfully deploy a DHCP solution using Linux on an enterprise network
  • Capture and observe DHCP packets using Wireshark
  • Capture and observe ARP packets using Wireshark
  • Successfully add hosts to a network and receive IP addresses automatically

Prerequisites

Deliverables

  • 5 Screenshots:
    • GNS3 workspace
    • Configuration of DHCP daemon
    • Wireshark – DHCP packets for PC1
    • Wireshark – DHCP packets for PC2
    • Wireshark – ARP packets for PC1/PC2

Resources

Contributors and testers

  • Mathew J. Heath Van Horn, PhD
  • Dante Rocca, Cybersecurity Student, ERAU-Prescott

Phase 0 – Professional Alignment

Enterprise networks depend on automated services to efficiently configure and manage connected devices. In this chapter, you will deploy a Kea DHCP server on Linux to automatically assign IPv4 addresses and network configuration information to client systems. You will also analyze DHCP and ARP traffic using Wireshark to understand how devices join a network and communicate with one another.

DCWF Work Roles

The knowledge and skills developed in this chapter align with the following Department of Defense Cyber Workforce Framework (DCWF) work roles:

  • 441 – Network Services Specialist
  • 511 – Network Operations Specialist
  • 531 – Systems Administrator

NICE Work Roles

This chapter supports competencies associated with the following NICE Workforce Framework for Cybersecurity work roles:

  • Network Services Specialist
  • Network Operations Specialist
  • Systems Administrator

Professional Skills

By completing this chapter, you will begin developing the ability to:

  • Deploy and configure a DHCP service using ISC Kea on Linux.
  • Automate IPv4 address assignment for enterprise network clients.
  • Capture and analyze DHCP and ARP traffic using Wireshark.
  • Validate client network configuration and connectivity.
  • Troubleshoot DHCP configuration and address assignment issues.
  • Document enterprise network services and verify their operation.

What You’ll Be Able to Do

After completing this chapter, you should be able to:

  • Install and configure a Kea DHCP server on an Ubuntu Linux server.
  • Configure DHCP address pools and network options for client devices.
  • Verify that network hosts automatically receive valid IPv4 configuration information.
  • Capture and interpret the DHCP Discover, Offer, Request, and Acknowledgment (DORA) exchange using Wireshark.
  • Capture and analyze ARP traffic to observe how devices resolve IP addresses to MAC addresses.
  • Troubleshoot common DHCP service and client connectivity problems.

Phase I – Build the Network Topology

This lab requires that ISC’s Kea DHCP Server be installed on an Ubuntu Server VM. In a terminal session, this can be verified with the following command:

apt list --installed kea-dhcp4-server
Kea DHCP server installed
Figure 2 – Kea DHCP server installed.

If you instead receive no output, the package manager did not find the specified software on the system. Install the kea-dhcp4-server package:

sudo apt update && sudo apt -y install kea-dhcp4-server

Moving forward, managing Linux boxes will become a staple in our networks. While this might be intimidating for those who are new to CLI environments, be assured that you will quickly learn. However, it is a good idea to refresh basic terminal navigation skills online before continuing.

  1. Start GNS3 and create a new project
  2. Add the following nodes to the workspace
    Name Version vCPU Memory
    Ubuntu-Server 24.04 LTS 1 2049 MiB
    Switch Ethernet switch [built-in] N/A N/A
    PC1 VPCS [built-in] N/A N/A
    PC2 VPCS [built-in] N/A N/A
  3. Connect the server and PCs to the switch

    NOTE: If you are running Ubuntu Server under VirtualBox, ensure that the Allow GNS3 to use any configured VirtualBox adapter checkbox is selected. Refer to Chapter 6: Adding a Virtual Machine to GNS3 for details.

  4. Label and organize your network as necessary

Phase II – Configure the DHCP Server

In this example, the DHCP server will be configured to support the following Class C subnet: 192.168.43.0/24

Self Check

Making Backups

Creating backups before editing critical files (such as configuration files) is always good practice. When you need them, they will save you time and headaches, so make it a habit now so you don’t regret it later.

Make a new backup folder in your home directory.

mkdir ~/backups

Make a copy of a file to the backups folder (sudo may be necessary depending on the security of the file).

cp /path/to/file/example.conf ~/backups/

Restore the file if needed.

cp ~/backups/example.conf /path/to/file/

Obviously, “/path/to/file/” and “example.conf” are placeholders. Adjust them as necessary to your situation.

Network Interface Configuration

  1. Start the Ubuntu Server and wait for it to boot

    NOTE: If your VM hangs during the boot process waiting for the systemd-networkd-wait-online service to finish, don’t worry! This is expected behavior.

    Ubuntu boot logs
    Figure 3 – Waiting for interfaces to be configured.

    Servers are expected to be reachable over a network, so part of the boot process includes waiting for all interfaces to be configured with an IP address (either automatically via DHCP or manually with a static address). This happens every time the system reboots.

  2. Open the console and log in

    NOTE: Traditional Linux command-line behavior will NOT move the cursor as you type the password. This security countermeasure prevents shoulder-surfing by obscuring the length of the secret being entered.

    Common Credentials

    ERAU CyberLab Pre-made VM: student:Security1
    Ubuntu Cloud Guest (GNS3): ubuntu:ubuntu

  3. Identify the network interface name

    Interface naming schemes can vary between operating systems.

    ip -c -br address show

    identifying the network interface name
    Figure 4 – Identifying the network interface name

    In this case, it is listed as ens3. However, other common names include enp0s3 and eth0. Be sure to adjust the following commands based on your environment.

  4. Understand Netplan configurations

    Netplan is a common utility for easily configuring networks via human-readable scripts. Netplan configuration files are formatted as text-based YAML (yet another markup language) files. Freshly installed systems that use Netplan typically have a default configuration in the /etc/netplan directory:

    ls -l /etc/netplan

    default netplan configuration file
    Figure 5 – Default Netplan config.

    However, many configuration files can live here. Netplan reads these files in lexical order, meaning 00-installer-config.yaml is processed before 10-custom-network.yaml, which is processed before 50-cloud-init.yaml, etc. Later configurations override settings from earlier configurations. This means we can add our own YAML file with a high number (e.g., 99) to change network settings without modifying the default config.

  5. Create a new Netplan config 99-my-gns3-network.yaml and assign the address 192.168.43.1/24 to the primary network interface

    sudo vi /etc/netplan/99-my-gns3-network.yaml

    editing a new netplan configuration file with VIM
    Figure 6 – Assigning IP address with Netplan.
    Parameter Description
    ens3 This is the name of the interface you want to configure, with options indented after. Adjust as necessary!
    optional Determines whether the system should wait to boot until the interface is configured (true means don’t wait).
    dhcp4 Determines whether the specified interface can dynamically receive IP addresses from a DHCP server.
    addresses Set static IP address value(s) to the specified interface.

    The Vi Text Editor

    You can use any preferred text editor, but it is recommended that you become familiar with Vi, which is installed by default on even the most minimal Linux distributions.

    Basic Vi Commands

    Press i to enter INSERT (editor) mode.

    Press Esc to return to COMMAND mode.

    Type :wq in COMMAND mode to write (w) the file and quit (q) back to the terminal.

    :wq

    Type :q! in COMMAND mode to exit without saving.

    :q!

  6. Modify the file’s permissions to only allow read and write access for the file owner (root)

    sudo chmod 0600 /etc/netplan/99-my-gns3-network.yaml

    NOTE: Don’t worry if you’re not yet familiar with Linux permissions; this will be covered in later chapters.

  7. Test the configuration and apply changes

    sudo netplan try

    netplan try command to apply network settings
    Figure 7 – Applying network configuration.

    NOTE: If you get an error, make sure your file matches the one provided. Double and triple-check for spelling and indentation errors!

  8. Check that the IP address was applied

    ip -c -br address show

    verifying ip address was applied from Netplan
    Figure 8 – IP address applied from Netplan.

    NOTE: Ensure a cable connects the VM to the switch in GNS3!

  9. In GNS3, add a label next to the server with its new host address

Kea DHCP Server Configuration

  1. Identify the directory for Kea configuration files

    By default, configurations for all Kea services are stored in the /etc/kea directory. Installing the “kea-dhcp4-server” package automatically creates this folder, as well as an example config file, kea-dhcp4.conf. We will add our custom server settings here.

    directory listing of /etc/kea
    Figure 9 – Kea default DHCPv4 configuration file.
  2. Modify the configuration file as shown below

    sudo vi /etc/kea/kea-dhcp4.conf

    example configuration of a dhcp server.
    Figure 10 – ISC Kea DHCP server configuration.

    NOTE: In this example, the address range is set from .100 -> .200, totaling 101 available leases. However, keep in mind this range is arbitrary, and the pool could theoretically include any of the 254 host addresses in the /24 subnet (except the DHCP server itself).

    To learn more about what each parameter does, visit the Kea DHCPv4 Server online documentation.

    NOTE: Lines beginning with “//” are comments and are for descriptive and documentation purposes.

  3. Test the file for syntax errors

    To save yourself from troubleshooting headaches later, test the configuration file for errors.

    kea-dhcp4 -t /etc/kea/kea-dhcp4.conf

    If it outputs log messages (example below), then no syntax errors were found. Otherwise, read the error, double-check spelling and missing commas, and retry the test.

    testing kea configuration file
    Figure 11 – Kea config passed error check.
  4. Verify that the service is enabled so that it starts automatically on boot

    systemctl is-enabled kea-dhcp4-server

    1. If disabled, enable the service

      sudo systemctl enable kea-dhcp4-server

  5. Restart the server

    sudo systemctl restart kea-dhcp4-server

  6. Verify the server is running

    systemctl status –no-pager kea-dhcp4-server

    dhcp server running
    Figure 12 – DHCP server running.

    NOTE: If you get an error, it is likely that there was a syntax error in your configuration file or the unit file was not updated correctly. Double-check for spelling mistakes and restart the server.

    You can view the logs of a failed service by typing the following command

    journalctl -xeu kea-dhcp4-server

    Switch Description
    -x / –catalog Provide more verbose/explanatory log and error messages.
    -e / –pager-end Jump to the end of the log file.
    -u / –unit Specify the service to view the log messages of.
  7. View listening UDP sockets

    As another method of verifying the service is working, use ss (successor of netstat) to view listening sockets on the machine. The kea-dhcp4 process should be bound to port 67, as shown below.

    ss -uln

    socket statistics for listening udp ports
    Figure 13 – Listening UDP ports.
    Switch Description
    -u / –udp Display UDP sockets.
    -l / –listening Display only listening sockets.
    -n / –numeric Do not resolve service names.
  8. Congratulations! This machine is now acting as the DHCP server for any endpoint that connects to the network

Phase III – Watch DHCP in Action

Remember, DHCP is a network management protocol that allows hosts to obtain IP addresses automatically upon request.  It uses the User Datagram Protocol (UDP): the server listens on port 67, and the client listens on port 68.

  • The end device (also called a client) will send out a discovery request (e.g., “Is anyone out there handing out names?”)
  • The server sees the discovery request and sends out a DHCP offer (e.g., “Yes, I see you, try 20.20.20.25”).
  • The client will then send a request packet (e.g., “Can I really use this name?”).
  • Finally, the server will send an acknowledgment packet (e.g., “20.20.20.25 is all yours, man”).
  1. Navigate to the GNS3 workspace
  2. Start a new Wireshark session on the PC1-Switch link
    pc1 to switch ethernet link for packet capturing
    Figure 14 – PC1 to switch link in GNS3
  3. Start PC1, open its console, and request a new IP address

    dhcp

    If successful, you should see the string DORA (discover, offer, request, acknowledge) in the VPCS console.

    PC1 successfully communicating with dhcp server
    Figure 15 – PC1 DORA

    PC1’s address will be within the pool range configured in Kea (.100 – .200), and “DHCP SERVER” will point to 192.168.43.1.

    verify pc1 ip address
    Figure 16 – PC1 IP address assignment

    If PC1 refuses to receive an IP address, either the Ubuntu server is unreachable,or the Kea server is not running (specifically check Step 7 in Phase II). Go back and troubleshoot before moving forward. If all else fails, try rebooting the server or restarting GNS3.

  4. Now go back to Wireshark and filter for DHCP packets captured between PC1 and the switch
    filtering dhcp packets in wireshark
    Figure 17 – Capturing DHCP packets over the wire.
    1. DHCP Discover

      [Packet 1] Look at the Discover packets. There is at least 1, but there could be more depending on network latency and server responsiveness. In this example, we see on Wireshark that someone on the network basically says “HELLLOOOO! I don’t know who I am (0.0.0.0); is there anyone out there handing out IP addresses?”

      Packet Breakdown

      Source IP: 0.0.0.0 (Who am I?)

      Destination IP: 255.255.255.255 (Who’s out there?)

      Source MAC: 00:50:79:66:68:00 (This is what my face looks like.)

      Destination MAC: ff:ff:ff:ff:ff:ff (Send to all devices on the LAN)

    2. DHCP Offer

      [Packet 2] Now, look at the DHCP Offer packet. It’s like our DHCP server (192.168.43.1) is saying, “Here is an available name (192.168.43.###).”

      Packet Breakdown

      Source IP: 192.168.43.1 (I’m here)

      Destination IP: 192.168.43.100 (Here’s an available address)

    3. DHCP Request

      [Packet 3] Then the next packet should be our no-name PC saying “I like the name 192.168.43.###” in a DHCP Request packet.

      Packet Breakdown

      Source: 0.0.0.0 (I still don’t have an official name yet)

      Destination: 255.255.255.255 (If you’re still out there, I want that address)

    4. DHCP ACK

      [Packet 4] Finally, our server acknowledges PC1 and says, “Ya buddy, you are now 192.168.43.### from now on and not just some schmo.”

      Packet Breakdown

      Source: 192.168.43.1 (I’m still here)

      Destination: 192.168.43.100 (You’re officially known as host .100 on this network)

  5. Repeat Step 3 to assign PC2 an IP address
  6. Return to GNS3 and update the VPCS labels with the addresses they were leased
    Adding labels to PC1 and PC2
    Figure 18 – Adding labels to PC1 and PC2

Phase IV – Watch ARP in Use

Remember, network packets are passed by MAC addresses in Layer 2 of the OSI Model. However, the network doesn’t know which IPv4 address belongs to which NIC on each host. The networks now see each other and ask, “Who are you?” In this example, 192.168.43.100 (PC1) asks who has the IPv4 address 192.168.43.1 (the DHCP server), and vice versa. You can see that 192.168.43.100 responds and says “My Layer 2 name is 0c:81:97:f5:00:00″. Don’t worry about the other packets you see currently; just get used to what ARP looks like so you can understand it when you see it again in the future.

  1. Return to the PC1-Switch Wireshark capture and filter for ARP packets

    NOTE: To generate ARP traffic, ping the DHCP server from PC1.

    filtering for arp packets in wireshark
    Figure 19 – Capturing ARP packets over the wire.
    1. Gratuitous ARP

      [Packets 1-3] After PC1 receives an IP address from the DHCP server, it will broadcast (ff:ff:ff:ff:ff:ff) to all devices on the local network that its MAC address (00:50:79:66:68:00) now belongs to a Layer 3 address (192.168.43.100). This is known as a “gratuitous ARP response”, since it was sent unprompted by any specific request.

      Packet Breakdown

      Sender MAC Address: 00:50:79:66:68:00

      Target MAC Address: ff:ff:ff:ff:ff:ff

      Sender/Target IP Address: 192.168.43.100

    2. Who has?

      [Packet 4] If a device wants to know who currently owns an IP address, it may send an ARP request to a specific MAC address or broadcast the message to all devices. In this example, PC1 (00:50:79:66:68:00) wants to know what the link-layer address of the DHCP server is.

      Packet Breakdown

      Source MAC: 00:50:79:66:68:00

      Destination MAC: ff:ff:ff:ff:ff:ff

      Sender IP Address: 192.168.43.100

      Target IP Address: 192.168.43.1

    3. ARP Reply

      [Packet 5] In response to an ARP request packet, the device that holds the target IP will respond with an ARP reply.

      Packet Breakdown

      Sender MAC Address: 0c:81:97:f5:00:00

      Target MAC Address: 00:50:79:66:68:00

      Sender IP Address: 192.168.43.1

      Target IP Address: 192.168.43.100

  2. Local ARP caches

    When a machine sees an ARP reply, it stores that MAC/IP association in an internal lookup table for later reuse. This prevents networks from being flooded with ARP packets every time a computer needs to send something over the network.

    show arp

    dumping PC1s arp cache
    Figure 20 – PC1’s ARP cache
  3. Use this opportunity to analyze Wireshark packets and get comfortable with how DHCP and ARP work on a live network

Career Connection

DHCP is one of the first infrastructure services deployed in nearly every enterprise network because it automates IP address management for workstations, servers, printers, phones, and other connected devices. Network engineers and systems administrators routinely deploy and maintain DHCP services while using packet analysis tools such as Wireshark to verify protocol operation and diagnose connectivity issues. Understanding both how to configure DHCP and how the protocol behaves on the network provides an essential foundation for managing enterprise infrastructure and troubleshooting real-world networking problems.

End of Lab

Deliverables

5 screenshots are needed to receive credit for this exercise:

  • GNS3 workspace
  • Configuration of DHCP daemon
  • Wireshark – DHCP packets for PC1
  • Wireshark – DHCP packets for PC2
  • Wireshark – ARP packets for PC1/PC2

Homeworks

Assignment 1 – Combined network traffic watching

  • Turn off all devices
  • Replace the switch with a hub and reconnect all devices
  • Monitor any of the PCs with Wireshark and capture ARP, DHCP, and ICMP packets for each PC as you turn devices back on
  • RECOMMENDED GRADING CRITERIA
    • Screenshot of GNS3 environment with everything labeled
    • Screenshot of Server-PC1 ARP from PC2-Hub link
    • Screenshot of Server-PC1 DHCP from PC2-Hub link
    • Screenshot of Server-PC1 ICMPfrom PC2-Hub link

Assignment 2 – Reconfigure the DHCP server

  • Figure out the number of devices that can be attached to the switch
  • Generate a random IP address and choose a subnet that will allow the use of all the switch connections with as few wasted IP addresses as possible
  • Reconfigure the network to use these new network addresses
  • Reconfigure the DHCP settings to issue IPv4 address in this new space
  • RECOMMENDED GRADING CRITERIA
    • Screenshot of the DHCP configuration file
    • Screenshot of the GNS3 workspace
    • Screenshot of DHCP on one PC
    • Screenshot of ICMP on one PC
Feedback email
Figure 00 – Contact us via prmaster@erau.edu

License

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Mastering Enterprise Networks (3rd Ed) Copyright © 2026 by Mathew J. Heath Van Horn is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.