24 Dynamic Host Configuration Protocol – Alpine Linux
Braedyn Case
Dynamic Host Configuration Protocol (DHCP) is an interactive client-server protocol that automatically provides a host (PC, Laptop, Phone, etc) with an Internet Protocol (IP) address upon request. The purpose of this activity is for learners to see DHCP in action rather than just read about the DHCP handshake theory. A secondary purpose is to have learners experience frustration when hosts do not receive a DHCP IP address. Learners can see how the packets move and where they may get hung up while working to ensure DHCP functions correctly on their network. Finally, learners can see Address Resolution Protocol (ARP) in action. While DHCP occurs when a host requests an IP address for an existing MAC address, ARP occurs when a host has an IP address but is unsure what MAC address it belongs to.
We strongly recommend you complete the DHCP-Linux lab first. Since this is essentially the DHCP-Linux lab, but using a different Linux distribution, these steps are somewhat abbreviated. It is assumed that you are already familiar with the DHCP-Linux lab. If you follow these steps exactly, you will create an Alpine Linux DHCP server, but your understanding will be limited. Alpine Linux is much lighter than Ubuntu Server, which helps address performance issues. Alpine Linux is terminal-only. Proceed with caution, as incorrect commands and incorrectly edited configuration files can break your VM!
Estimated time for completion: 60 minutes
Phase 0 – Professional Alignment
Enterprise networks rely on automated network services to efficiently configure and manage connected devices. In this chapter, you will deploy a Kea DHCP server on Alpine Linux, gaining experience with a lightweight Linux distribution commonly used in virtualized, containerized, and embedded environments. You will also analyze DHCP and ARP traffic using Wireshark while developing the troubleshooting skills needed to diagnose network service failures.
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 DHCP services on a Linux server using Kea DHCP.
- Administer network services from the Linux command line.
- Capture and analyze DHCP and ARP protocol traffic using Wireshark.
- Validate automatic IP address assignment for enterprise clients.
- Troubleshoot DHCP configuration and client connectivity problems.
- Document and verify enterprise network service deployments.
What You’ll Be Able to Do
After completing this chapter, you should be able to:
- Install the required Kea DHCP software packages on Alpine Linux.
- Configure and manage a Kea DHCP server using command-line tools and configuration files.
- Verify that client devices automatically receive valid IPv4 addressing information.
- Capture and interpret the DHCP Discover, Offer, Request, and Acknowledgment (DORA) process using Wireshark.
- Capture and analyze ARP traffic to understand Layer 2 address resolution.
- Diagnose and resolve common DHCP configuration and connectivity issues within an enterprise network.
LEARNING OBJECTIVES
- Successfully deploy a DHCP solution using Alpine Linux on an enterprise network
- Capture and Observe DHCP packets using Wireshark
- Capture and Observe ARP packets using Wireshark
- Successfully add hosts to an enterprise network and receive IP addresses automatically
PREREQUISITES
DELIVERABLES
- 5 Screenshots:
- Wireshark – DHCP Packets for PC1
- Wireshark – DHCP Packets for PC2
- Wireshark – ARP Packets for PC1/PC2
- GNS3 Workspace
- Configuration of the DHCP Daemon
RESOURCES
CONTRIBUTORS AND TESTERS
- Antionette Hults, Cybersecurity Student, ERAU-Prescott
- Mathew J. Heath Van Horn, PhD
Phase I – Create the DHCP server vm

- Open Oracle VirtualBox
- Right-click on your Alpine VM and click Clone
- In the Name field type “DHCP-Alpine”
- Under clone type, select “Full Clone”
- Under MAC Address Policy, select “Generate new MAC address for all network adapters”
- Select DHCP-Alpine and start the VM
- Log in with the same credentials you used to create the original Alpine VM. In our example, we used:
- Username: root
- Password: toor
- Use the command line to install two packages using the command below
apk add kea-dhcp4 curl
| Command | Purpose |
|---|---|
| apk | (Alpine Package Keeper) is the default package manager for Alpine Linux. It is used to install, update, upgrade, and delete software packages on the system. |
| add | Used to install or update software packages on Alpine Linux |
| kea-dhcp4 | Kea is the full-featured, open source, standards-based DHCP server distribution from the Internet Systems Consortium authority |
| curl | (Client URL) is a powerful command-line utility used in Linux to transfer data to or from a remote server |
Phase II – Configure kea
- Go to the kea config directory by typing the command
cd /etc/kea
Command Purpose cd Change Directory – a built-in shell tool used to navigate through files and folders /etc/kea Change working directory to the kea subfolder of the etc folder. The (et cetera) folder is the nerve center of a Linux system. It stores all system-wide configuration files. 
Figure 1 – Entering the kea config directory - Once in the directory, backup the kea-dhcp4.conf and delete the original one by running the following commands
-
cp kea-dhcp4.conf kea-dhcp4.bak
cp is the Linux command for “copy”
-
rm kea-dhcp4.conf
rm is the Linux command for “remove”
-
- Download the new kea-dhcp4.conf by typing the command
curl -O https://raw.githubusercontent.com/braedyncase06/MasteringEnterpriseNetworks/main/Alpine-kea-configs/kea-dhcp4.conf
NOTE: The dash is not followed by a zero; it is followed by an O as in Oscar. Also, the link must be perfectly copied for this command to work. Because Alpine Linux is so minimal, there is no copy and paste function between your computer and the VM terminal. So take your time entering the above command, or you will have to redo it!
- Verify that the download was successful by typing the command
cat kea-dhcp4.conf
- The contents of the file should match the following image

Figure 2 – The kea config file contents should match this image - If the contents DO NOT match the picture above, go back to step 3 and ensure that you type in the link correctly.
NOTE: You can manually adjust the Kea IPv4 configuration file by following the instructions in the DHCP-Linux chapter.
Phase III – Configure the VM NIC for DHCP
The Network Interface Configuration for the VM needs configuration so that it will keep it’s IP address.
- Run the command
vi /etc/network/interfaces
- In the text editor, scroll down to the last line that contains “iface eth0 inet dhcp”
- Press “i” to edit the file
- Remove the dhcp part at the end of the line
- type in “static”
- The line should now read “iface eth0 inet static”
- Press Enter to go to the blank line beneath and press Tab
- In the newly indented line type “address 200.200.200.254”
- Press Enter to make a new line and press Tab
- In the newly indented line type “netmask 255.255.255.0”
- Press Enter to make a new line and press Tab
- In the newly indented line type “gateway 200.200.200.1”
- The file should look like the following image

Figure 3 – Network interfaces file should look like this - Press Escape to stop editing the file
- Then type in “:wq” to save changes and exit out of the text editor
- Type the following command to activate kea dhcp server upon boot
rc-update add kea-dhcp4 default
Command Use rc-update A utility used to manage which services start automatically at boot add Add the following service to the rc-update utility kea-dhcp4 The file we just edited using vi deafult Start normal operational services after - Power down the VM
Phase IV – Configure the GNS3 Environment
Now that KEA is setup on the VM, we can add it to the GNS3 environment.
- Open GNS3
- Wait for the GNS3 VM to connect and for the status indicator to turn green
- Create a new project by going to File > New Blank Project

Figure 4 – Making a new GNS3 Project - Name the project whatever you want (Mine is called DHCP-Alpine)
- To add the VM, go to the top of the window, click on Edit > Preferences > VirtualBox VMs

Figure 5 – Add the VM to GNS3 - Click on New
- In the Window, select Run this VirtualBox VM on my local computer
- Click Next
- In the next window, click the dropdown arrow and select the name of your Alpine DHCP VM that you made
- Click Finish

Figure 6 – Selecting the VM to add to GNS3 - In the GNS3 project window, go to Browse End Devices (Desktop Computer Icon at the left of the window)
- Double-click on the VM you added
- In the configuration window, click on Network
- At the bottom of the window, check the box next to Allow GNS3 to use any configured VirtualBox adapter

Figure 7 – Configuring the Network Interface - Click OK
- Drag DHCP-Alpine into the project space
- Drag VPCS into the project space
- When the pop-up window opens, click the dropdown arrow and select GNS3 VM
- Click OK
- Drag another VPCS into the project space
- When the pop-up window opens, click the dropdown arrow and select GNS3 VM
- Click OK
- Go to Switches (just above Browse End Devices)
- Drag the Ethernet Switch into the project space
- When the pop-up window opens, click the dropdown arrow and select GNS3 VM
- To the left of the window, click on the wire icon
- Click on DHCP-Alpine-1 and select Ethernet0, then click on Switch1 and select Ethernet0
- Click on PC1 and select Ethernet0 then click on Switch1 and select Ethernet1
- Click on PC2 and select Ethernet0 then click on Switch1 and select Ethernet2

Figure 8 – Basic DHCP Network
Phase V – See DHCP in action
- At the top of the window, press the start button
- After all devices start fully (indicator at the right is green), right-click on the wire between PC1 and Switch1
- Click Start Capture
- In the pop-up window, click OK
- Go back to the GNS3 Project window and right-click on PC1
- Click Console
- In the console, type the command
ip dhcp
- You should see DORA printed on the terminal, indicating that you have successfully connected to your DHCP server!

Figure 9 – Successful connection to the Alpine DHCP Server - You should also see a full DHCP handshake in your Wireshark capture

Figure 10 – Observing DHCP Handshake 10. Repeat with PC2 and then try to ping PC1 with the newly assigned IP addresses
Career Connection
Automated network services such as DHCP are essential to modern enterprise operations, and many organizations deploy these services on lightweight Linux platforms to improve efficiency and simplify administration. Network engineers, systems administrators, and cybersecurity professionals routinely configure, monitor, and troubleshoot DHCP services while validating network behavior with packet analysis tools such as Wireshark. The combination of Linux command-line administration, protocol analysis, and troubleshooting practiced in this chapter reflects the day-to-day responsibilities of professionals responsible for maintaining reliable enterprise network infrastructure.
End of Lab
Deliverables
5 screenshots are needed to receive credit for this exercise:
- Wireshark – DHCP Packets for PC1
- Wireshark – DHCP Packets for PC2
- Wireshark – ARP Packets for PC1/PC2
- GNS3 Workspace
- Configuration of DHCP Daemon
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 of one PC
- Screenshot of ICMP of one PC
