Arch Linux BasedManjaro

How To Configure DHCP Server on Manjaro

Configure DHCP Server on Manjaro

Managing IP addresses manually on a growing network is a recipe for conflicts, misconfigurations, and wasted hours. Whether you are running a home lab, a small office network, or a development environment with multiple virtual machines, automating IP assignment is the right move. This guide shows you exactly how to install DHCP Server on Manjaro, configure it from scratch, and get it serving IP addresses to clients on your network. By the end of this tutorial, you will have a fully working DHCP server running as a systemd service on Manjaro Linux.

What Is DHCP and Why Does It Matter?

Dynamic Host Configuration Protocol (DHCP) is a network protocol that automatically assigns IP addresses, subnet masks, default gateways, and DNS server addresses to devices on a network. Instead of logging into each machine and typing in network settings by hand, you configure the server once and every device that joins the network gets its settings automatically.

The protocol works through a four-step exchange called DORA:

  1. Discover — the client broadcasts a request looking for a DHCP server
  2. Offer — the server responds with an available IP address
  3. Request — the client formally requests the offered address
  4. Acknowledge — the server confirms the lease and the client configures itself

Each IP address is issued as a lease, meaning it is valid for a set period of time. When the lease expires, the client either renews it or the IP goes back into the pool for another device.

On Manjaro, the DHCP server daemon is called dhcpd (from the ISC DHCP package). It is important to know that dhcpd (the server) is completely different from dhcpcd (the client). A common mistake among beginners is installing or starting the wrong one.

ISC, the organization behind the software, no longer actively develops dhcpd and now promotes Kea as its modern replacement. However, dhcpd remains stable, widely used, and fully available in the Manjaro/Arch repositories, making it the practical choice for most setups today.

Prerequisites

Before you start, make sure you have the following ready:

  • Manjaro Linux installed (any edition: KDE, GNOME, XFCE, or minimal)
  • A user account with sudo privileges
  • At least one wired network interface (e.g., enp0s3 or eth0)
  • An active internet connection to download packages
  • Basic comfort using the terminal and a text editor like nano or vim
  • The ip command available (installed by default on Manjaro via iproute2)

You do not need a dedicated server machine. A standard Manjaro desktop install works perfectly, especially for lab environments and VM-based testing.

Step 1: Check Your Network Interface Name

Modern Linux systems use predictable interface names instead of the old eth0 convention. Your wired interface might be named enp0s3, enp2s0, or something similar depending on your hardware.

Run this command to list all network interfaces:

ip a

Look for your wired interface in the output. A typical result looks like this:

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet 192.168.1.104/24 brd 192.168.1.255 scope global dynamic enp0s3

Note your interface name. You will use it throughout this tutorial. In all examples below, enp0s3 is the interface name — replace it with your actual interface name if it differs.

Step 2: Assign a Static IP to the Server Interface

A DHCP server cannot rely on a dynamic IP address. You must give the network interface a static (fixed) IP address before the DHCP daemon will work correctly. The static IP you assign here will also become the default gateway you distribute to clients.

Assign a Temporary Static IP (Testing Only)

Run these two commands to bring up the interface and assign a static address:

sudo ip link set up dev enp0s3
sudo ip addr add 192.168.1.1/24 dev enp0s3

This sets 192.168.1.1 as the server’s address on the 192.168.1.0/24 subnet. This configuration does not survive a reboot, so use it only for initial testing.

Make the Static IP Persistent via NetworkManager GUI

For a permanent setup, use Manjaro’s built-in network manager:

  1. Open Advanced Network Configuration from the application menu
  2. Select your wired interface and click the gear icon
  3. Go to the IPv4 Settings tab
  4. Change Method to Manual
  5. Add your address: 192.168.1.1, Netmask: 255.255.255.0, Gateway: leave blank (or 192.168.1.1)
  6. Click Save and reconnect

Make the Static IP Persistent via netctl (CLI Method)

If you prefer the command line, copy the static ethernet example profile:

sudo cp /etc/netctl/examples/ethernet-static /etc/netctl/enp0s3-static
sudo nano /etc/netctl/enp0s3-static

Edit the file to match your interface and desired address:

Interface=enp0s3
Connection=ethernet
IP=static
Address=('192.168.1.1/24')
Gateway='192.168.1.1'
DNS=('8.8.8.8')

Enable and start the profile:

sudo netctl enable enp0s3-static
sudo netctl start enp0s3-static

Important: The subnet you assign here must exactly match the subnet block you will write in dhcpd.conf. If they do not match, the dhcpd service will fail to start.

Step 3: Update Your System and Install the DHCP Package

Before installing anything on Manjaro, always sync and update the package database. Running an out-of-date package cache is one of the most common causes of install failures on rolling-release distros like Manjaro.

Update the System

sudo pacman -Syu

This command syncs the package database and upgrades all installed packages. Allow it to complete fully before proceeding.

Install the dhcp Package

The dhcp package provides the dhcpd server binary:

sudo pacman -S dhcp

Confirm the installation when prompted. pacman will download and install the package along with any required dependencies.

Verify the Installation

Check that dhcpd is now available:

dhcpd --version

You should see output similar to:

isc-dhcpd-4.4.3P1

Back Up the Default Config File

The default dhcpd.conf file is full of uncommented examples that will cause the daemon to fail if left unchanged. Back it up immediately:

sudo cp /etc/dhcpd.conf /etc/dhcpd.conf.example

Now you have a clean reference copy and a blank slate to work from.

Step 4: Configure the DHCP Server on Manjaro

This is the most important step. The /etc/dhcpd.conf file controls everything about how your DHCP server behaves — which addresses it hands out, how long leases last, and what DNS and gateway information clients receive.

Open the config file in nano:

sudo nano /etc/dhcpd.conf

Write a Minimal Working Configuration

Clear any existing content and write the following configuration:

# DNS servers sent to clients
option domain-name-servers 8.8.8.8, 8.8.4.4;

# Subnet mask sent to clients
option subnet-mask 255.255.255.0;

# Default gateway (your server's static IP)
option routers 192.168.1.1;

# Lease times in seconds
default-lease-time 600;
max-lease-time 7200;

# Mark this server as authoritative for the subnet
authoritative;

# Subnet declaration
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.100 192.168.1.200;
}

Here is what each directive does:

  • domain-name-servers — the DNS servers your clients will use. Google’s public DNS (8.8.8.8, 8.8.4.4) is a reliable default.
  • subnet-mask — tells clients how large the network is. 255.255.255.0 means only the last octet varies.
  • routers — the default gateway clients use to reach the internet. This should be your server’s static IP.
  • default-lease-time 600 — if a client does not request a specific lease length, it gets 600 seconds (10 minutes).
  • max-lease-time 7200 — the maximum time (2 hours) a client can hold a lease.
  • authoritative — tells dhcpd it is the definitive DHCP server on this subnet.
  • subnet block — defines the network dhcpd will serve. The range line sets the pool of addresses available for dynamic assignment.

Add a Static IP Reservation for a Specific Device

If you have a device — a printer, NAS, or server — that always needs the same IP, you can bind an address to its MAC address:

host myprinter {
    hardware ethernet 00:11:22:33:44:55;
    fixed-address 192.168.1.50;
}

Replace 00:11:22:33:44:55 with the actual MAC address of the device. You can find a device’s MAC address by running ip a on that machine and looking for the link/ether field.

Optional: Add a Domain Name for Your Network

If you run a local DNS setup or want clients to recognize a local domain, add this line in the global section:

option domain-name "home.local";

Save the file with CTRL+O, then press Enter, and exit with CTRL+X.

Test the Configuration File for Syntax Errors

Before starting the service, always run a syntax check:

sudo dhcpd -t -cf /etc/dhcpd.conf

If there are no output messages or errors, the file is valid. Any syntax error will print with the line number so you can fix it before the service attempts to start.

Step 5: Restrict dhcpd to a Specific Network Interface

By default, dhcpd tries to listen on all network interfaces. If it finds an interface without a matching subnet declaration in the config file, it throws an error and refuses to start. The cleanest solution is to override the systemd service and tell dhcpd exactly which interface to use.

Create a systemd service override:

sudo systemctl edit dhcpd4.service

This opens an override editor. Add the following content:

[Service]
ExecStart=
ExecStart=/usr/bin/dhcpd -4 -q -cf /etc/dhcpd.conf enp0s3

The first ExecStart= line clears the default command. The second line sets the new command, passing your interface name (enp0s3) as the final argument. Replace enp0s3 with your actual interface name.

Save and close the editor, then reload the systemd daemon:

sudo systemctl daemon-reload

Step 6: Start, Enable, and Verify the DHCP Service

With the configuration in place and the service override set, you are ready to start the DHCP server.

Start the Service

sudo systemctl start dhcpd4.service

Enable It to Start at Boot

sudo systemctl enable dhcpd4.service

This creates a symlink so dhcpd4.service starts automatically every time Manjaro boots.

Check the Service Status

sudo systemctl status dhcpd4.service

A healthy output looks like this:

● dhcpd4.service - ISC DHCP Server IPv4
   Active: active (running) since Tue 2026-03-31 06:00:00 WIB; 5s ago

If the status shows failed or inactive, check the journal for error details before moving on.

Configure DHCP via netctl (Alternative Client-Side Method)

If you want to configure a different Manjaro machine on your network to receive an IP from your new DHCP server using netctl, copy the ethernet-dhcp example profile:

sudo cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/enp0s3
sudo nano /etc/netctl/enp0s3

Change the Interface line to your actual interface:

Interface=enp0s3
Connection=ethernet
IP=dhcp

Enable and start the profile:

sudo netctl enable enp0s3
sudo netctl start enp0s3

Run ip a on the client machine to confirm it received a dynamic IP address in your configured range (192.168.1.100 to 192.168.1.200).

Step 7: Verify the DHCP Server Is Working

Starting the service is not the same as confirming it is working correctly. Take these steps to verify end-to-end functionality.

Check Active Leases

cat /var/lib/dhcp/dhcpd.leases

You will see entries like this for every connected client:

lease 192.168.1.105 {
  starts 2 2026/03/31 06:05:00;
  ends 2 2026/03/31 06:15:00;
  binding state active;
  hardware ethernet 08:00:27:ab:cd:ef;
}

Monitor Live DHCP Traffic with journalctl

sudo journalctl -u dhcpd4.service -f

When a client connects, you should see the full DORA handshake:

DHCPDISCOVER from 08:00:27:ab:cd:ef via enp0s3
DHCPOFFER on 192.168.1.101 to 08:00:27:ab:cd:ef via enp0s3
DHCPREQUEST for 192.168.1.101 from 08:00:27:ab:cd:ef via enp0s3
DHCPACK on 192.168.1.101 to 08:00:27:ab:cd:ef via enp0s3

Each of those four lines confirms the DORA handshake completed and the client has been assigned an address.

Test Connectivity from a Client

ping 192.168.1.1

A successful ping confirms the client and server are communicating correctly on the network.

Troubleshooting Common Issues

Even with careful setup, problems can appear. Here are the five most common issues and how to fix them.

Error 1: dhcpd4.service Fails to Start

Symptom: systemctl status dhcpd4.service shows Active: failed.

Cause: The subnet in /etc/dhcpd.conf does not match the interface IP, or the config has a syntax error.

Fix:

sudo dhcpd -t -cf /etc/dhcpd.conf
ip addr show enp0s3

The subnet in dhcpd.conf must match the interface network. If the interface is 192.168.1.1/24, the subnet must be 192.168.1.0 netmask 255.255.255.0.

Error 2: Clients Are Not Receiving IP Addresses

Symptom: Client machines show 169.254.x.x (APIPA) addresses or fail to get an IP.

Cause: A firewall is blocking UDP ports 67 and 68, or dhcpd is not on the right interface.

Fix:

sudo ufw allow 67/udp
sudo ufw allow 68/udp

Error 3: Lease File Errors on Service Start

Symptom: Journal shows Can't open lease database /var/lib/dhcp/dhcpd.leases.

Cause: The lease file does not exist yet or has become corrupted.

Fix:

sudo touch /var/lib/dhcp/dhcpd.leases
sudo systemctl restart dhcpd4.service

Error 4: Wrong Interface Name in Config

Symptom: dhcpd starts but no clients receive addresses.

Cause: The interface name in the systemd override does not match the actual interface.

Fix:

sudo systemctl edit dhcpd4.service
sudo systemctl daemon-reload
sudo systemctl restart dhcpd4.service

Error 5: dhcpd Gives Addresses Outside the Defined Range

Symptom: Clients receive unexpected IP addresses due to stale lease entries.

Cause: Stale entries in the lease file are conflicting with new requests.

Fix:

sudo systemctl stop dhcpd4.service
sudo truncate -s 0 /var/lib/dhcp/dhcpd.leases
sudo systemctl start dhcpd4.service

Congratulations! You have successfully set up the DHCP server. Thanks for using this tutorial to configure the DHCP server on your Manjaro Linux system. For additional help or useful information, we recommend you check the official Fedora website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a dedicated and highly skilled Linux Systems Administrator with over a decade of progressive experience in designing, deploying, and maintaining enterprise-grade Linux infrastructure. His professional journey began in the telecommunications industry, where early exposure to Unix-based operating systems ignited a deep and enduring passion for open-source technologies and server administration.​ Throughout his career, r00t has demonstrated exceptional proficiency in managing large-scale Linux environments, overseeing more than 300 servers across development, staging, and production platforms while consistently achieving 99.9% system uptime. He holds advanced competencies in Red Hat Enterprise Linux (RHEL), Debian, and Ubuntu distributions, complemented by hands-on expertise in automation tools such as Ansible, Terraform, Bash scripting, and Python.
Back to top button