Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Ubuntu Server DHCP Lab

A hands-on lab demonstrating the deployment of an ISC DHCP Server on Ubuntu Server, including isolated VMware lab networking, static IP configuration via Netplan, dual-NIC internet access, DHCP scope configuration, multi-client testing, and lease verification.

The project demonstrates an end-to-end Linux network-services deployment, including the real installation and configuration problems encountered along the way and how each was diagnosed and resolved.


Project Overview

The goal of this lab was to stand up a dedicated DHCP server on Ubuntu Server, running inside an isolated VMware lab network, and confirm that both a Windows 10 client and a Kali Linux client could automatically obtain IP addresses from it.

The deployment involved:

  • Installing Ubuntu Server on VMware Workstation
  • Building an isolated VMware host-only lab network (192.168.50.0/24)
  • Configuring a static IP on the lab-facing interface (ens33) via Netplan
  • Adding a second NIC (ens37) for NAT/internet access
  • Installing and configuring the ISC DHCP Server (isc-dhcp-server)
  • Defining a DHCP scope, address pool, gateway, and DNS servers
  • Validating the DHCP configuration before going live
  • Testing DHCP clients: Windows 10 and Kali Linux
  • Verifying issued leases from the server side

Lab Environment

Component Role
Ubuntu Server 24.04.4 LTS DHCP server (isc-dhcp-server)
VMware Workstation Virtualization platform for all lab VMs
VMnet2 (Host-only) Isolated lab network for DHCP testing
NAT adapter Internet access for the Ubuntu Server (package installs, DNS)
Windows 10 DHCP client used for testing
Kali Linux DHCP client used for testing
ens33 Ubuntu Server interface facing the isolated lab network (static: 192.168.50.1/24)
ens37 Ubuntu Server interface facing NAT/internet (DHCP-assigned)
DHCP pool 192.168.50.100 – 192.168.50.200
DNS servers handed out 8.8.8.8, 1.1.1.1

Architecture

Windows 10 Client ─┐
                    ├── VMnet2 (192.168.50.0/24, Host-only) ── ens33 (192.168.50.1) ── Ubuntu Server ── isc-dhcp-server
Kali Linux Client ──┘                                                                        │
                                                                                          ens37 (NAT)
                                                                                              │
                                                                                          Internet

1. Installing Ubuntu Server

The lab began with a fresh install of Ubuntu Server through the standard text-based installer (language, keyboard, storage, profile, and SSH configuration).

Guided Storage Configuration

The profile was configured with the server hostname and admin account used throughout the rest of the lab.

Profile Configuration

Partway through the first install attempt (Ubuntu Server 26.04), the installation crashed with a media/kernel crash report, and a subsequent boot attempt failed with a PXE "Operating System not found" error — see Troubleshooting below for how this was resolved.

Installation Crash Report

PXE Boot Failure

After switching to a different Ubuntu Server ISO (24.04.4 LTS), the install completed cleanly.

Installation Complete

First login to the new server confirmed the system was ready for configuration.

First Login


2. Network Interface Identification & Isolated Lab Network

The server's network interface was identified using ip addr / ip -br addr, showing ens33 as the primary NIC (initially DHCP-assigned by VMware NAT).

ip -br addr Initial

An isolated lab network was built in VMware's Virtual Network Editor using VMnet2 (Host-only), with VMware's own DHCP service disabled so it wouldn't compete with the Ubuntu DHCP server being built in this lab.

VMware Virtual Network Editor

VMnet2 DHCP Disabled

The Kali, Windows 10, and Ubuntu Server VM network adapters were all pointed at VMnet2, joining them to the same isolated lab segment.

Kali VM Network Adapter → VMnet2

Windows 10 VM Network Adapter → VMnet2

Before the DHCP server was configured, both clients confirmed they had no usable IPv4 address on the lab network — Kali showed only a link-local IPv6 address, and Windows fell back to an APIPA address.

Kali ifconfig — No IP

Windows ipconfig — APIPA

ens33 was then given a static IP through Netplan (/etc/netplan/50-cloud-init.yaml), assigning it 192.168.50.1/24 as the gateway address for the lab network.

Netplan Directory

Editing Netplan for Static IP

Getting the YAML syntax right took two attempts — see Troubleshooting — after which netplan apply succeeded and ens33 came up with the correct static address.

ens33 Static IP Confirmed


3. Adding Internet Access (ens37)

With ens33 now statically addressed and isolated from NAT, the server lost DNS/internet access, which caused apt update and the initial isc-dhcp-server install to fail (see Troubleshooting).

apt update DNS Failure

A second virtual NIC (ens37) was added to the Ubuntu Server VM and set to NAT, giving the server a separate path to the internet independent of the isolated lab network.

Adding NIC 2 (NAT)

ens37 was added to the Netplan configuration with dhcp4: true, then applied.

Netplan — ens37 Added (DHCP)

Netplan Apply — ens37 Success

Internet connectivity and DNS resolution were confirmed with ping tests.

Ping 8.8.8.8 — Success

Ping archive.ubuntu.com — DNS Success


4. Installing and Configuring the ISC DHCP Server

With internet access restored via ens37, isc-dhcp-server installed successfully.

isc-dhcp-server Install Success

The server was configured to listen only on the lab-facing interface by setting INTERFACESv4="ens33" in /etc/default/isc-dhcp-server.

INTERFACESv4 Set to ens33

The DHCP scope was then defined in /etc/dhcp/dhcpd.conf:

subnet 192.168.50.0 netmask 255.255.255.0 {
    range 192.168.50.100 192.168.50.200;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.50.255;
    option routers 192.168.50.1;
    option domain-name-servers 8.8.8.8, 1.1.1.1;
    default-lease-time 600;
    max-lease-time 7200;
}

dhcpd.conf Subnet Configuration

The configuration was validated with dhcpd -t before restarting the service, then the service was restarted and confirmed active.

dhcpd Config Test Validation

isc-dhcp-server systemctl status

ss -upln was used to confirm the DHCP service was actively listening on UDP port 67.

Listening on UDP Port 67


5. Client Testing — Windows 10 and Kali Linux

On the Windows 10 client, ipconfig /release followed by ipconfig /renew picked up a lease from the new DHCP server, and the assigned gateway was reachable by ping.

Windows ipconfig /renew — Success

On the Ubuntu server side, the isc-dhcp-server journal log showed both clients being offered and acknowledging leases — Windows (DESKTOP-494EDEB) received 192.168.50.100, and Kali received 192.168.50.101.

DHCP Lease Log — Both Clients

On the Kali Linux client, ip -br addr and ip route confirmed the assigned address and a working default route via the DHCP-supplied gateway.

Kali ip route Confirmed


6. Lease Verification

The final validation step read the DHCP server's own lease database (/var/lib/dhcp/dhcpd.leases) directly, confirming both the Kali and Windows leases as active, bound to the correct MAC addresses and hostnames.

dhcpd.leases — Final Verification


Troubleshooting Performed

Several problems were encountered and resolved during this lab.

Ubuntu Server 26.04 Install Crash / PXE Boot Failure

The first install attempt, using an Ubuntu Server 26.04 ISO, crashed during installation with a media/checksum-related crash report, and a subsequent boot attempt returned a PXE "Operating System not found" error because no OS had actually been written to disk.

Troubleshooting included:

  • Reviewing the crash report to confirm an install media issue rather than a hardware fault
  • Swapping the VM's CD/DVD image to a different, known-good ISO (Ubuntu Server 24.04.4 LTS)
  • Re-running the installer end-to-end, which completed successfully

Netplan YAML Errors When Setting a Static IP

Configuring the static IP on ens33 surfaced two separate Netplan/YAML errors before it was accepted:

  1. sudo netplan try"Error in network definition: expected mapping (check indentation)" — caused by the addresses: key not being nested correctly under ens33. Fixed by correcting the YAML indentation.
  2. sudo netplan generate"Error in network definition: expected sequence" — caused by writing the address as a plain list item (- 192.168.50.1/24) instead of proper YAML flow-sequence syntax. Fixed by rewriting it as addresses: [192.168.50.1/24].

After both fixes, netplan generate and netplan apply completed without errors.

Loss of Internet/DNS Access After Setting a Static IP

Once ens33 was moved to a static, isolated address, sudo apt update and the first sudo apt install isc-dhcp-server attempt both failed with "Temporary failure resolving" errors, because the server no longer had a route to the internet or a DNS resolver.

Troubleshooting included:

  • Confirming the package truly hadn't installed (ls /etc/default/isc-dhcp-serverNo such file or directory)
  • Adding a second virtual NIC (ens37) set to NAT in VMware
  • Adding ens37 to Netplan with dhcp4: true and re-applying
  • Re-testing with ping 8.8.8.8 and ping archive.ubuntu.com to confirm both connectivity and DNS resolution before retrying the install

Permission Denied Reading the Netplan Config

Running cat /etc/netplan/50-cloud-init.yaml as a normal user returned "Permission denied", since Netplan configuration files are root-owned for security. Re-running the same command with sudo resolved it.

DHCP Request Ignored From an Unrelated Subnet

The isc-dhcp-server log showed one DHCPREQUEST for an address on the 192.168.138.0/24 (NAT) network being ignored as "not authoritative". This was expected, correct behavior — it confirmed the DHCP server was correctly scoped to only the 192.168.50.0/24 lab subnet and would not respond to or hand out addresses for a network it wasn't configured to manage.


What This Lab Demonstrates

This project demonstrates practical experience with:

  • Ubuntu Server administration
  • VMware virtual networking (Host-only / NAT, Virtual Network Editor)
  • Netplan configuration and YAML troubleshooting
  • Static IP configuration
  • Multiple network interfaces on a single host
  • ISC DHCP Server installation and configuration
  • DHCP scope, pool, gateway, and DNS configuration
  • DHCP configuration validation (dhcpd -t)
  • Windows DHCP client testing and troubleshooting
  • Linux DHCP client testing and troubleshooting
  • DHCP lease verification from both client and server perspectives
  • Systematic troubleshooting of install failures, YAML syntax errors, and DNS/connectivity issues

Repository Documentation

Detailed screenshot walkthroughs are available here:


Repository Structure

Ubuntu-Server-DHCP-Lab/
│
├── README.md
│
├── docs/
│   ├── 01-INSTALLATION.md
│   ├── 02-NETWORK-CONFIGURATION.md
│   ├── 03-DHCP-SERVER-SETUP.md
│   ├── 04-CLIENT-TESTING-VERIFICATION.md
│   └── SCREENSHOT-INDEX.md
│
└── images/
    ├── 01-installation/
    ├── 02-network-configuration/
    ├── 03-dhcp-server-setup/
    ├── 04-client-testing/
    └── 05-verification/

Final Outcome

Ubuntu Server 24.04.4 LTS
          ↓
ens33 (static 192.168.50.1/24) ── ens37 (NAT, DHCP)
          ↓
isc-dhcp-server
          ↓
DHCP Pool 192.168.50.100–200
          ↓
VMnet2 (Host-only Lab Network)
          ↓
Windows 10 (192.168.50.100)  +  Kali Linux (192.168.50.101)

The lab successfully demonstrated an end-to-end DHCP server deployment on Ubuntu Server, including the real install failures, YAML syntax errors, and connectivity issues encountered along the way, and the troubleshooting steps used to resolve each one. Both a Windows 10 and a Kali Linux client successfully obtained leases from the server, and those leases were verified from both the client and server sides.

About

Hands-on Ubuntu Server lab demonstrating DHCP server deployment, Netplan network configuration, DHCP scope creation, and automatic IP address assignment to Windows 10 and Kali Linux clients

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors