From ArchWiki
Revision as of 04:34, 28 December 2013 by DJ L (talk | contribs) (Listening on only one interface: Updated instructions to reflect network designation instead of interface)
Jump to: navigation, search

dhcpd is the Internet Systems Consortium DHCP Server. It is useful for instance on a machine acting as a router on a LAN.


Install the dhcp package, available in the official repositories.


Assign an static IPv4 address to the interface you want to use (usually eth0). The first 3 bytes of this address cannot be exactly the same as those of another interface.

# ip link set up dev eth0
# ip addr add dev eth0 # arbitrary address

To have your static ip assigned at boot, see Network Configuration#Static IP address.

The default dhcpd.conf contains many uncommented examples, so relocate it

# mv /etc/dhcpd.conf /etc/dhcpd.conf.example

Edit the configuration file to contain:

# Using the google's dns in the example.
# Change it to if you have a dns server installed
option domain-name-servers;
option subnet-mask;
option routers;
subnet netmask {

Start the dhcpd daemon with dhcpd4.service using systemctl. Optionally, enable it to start automatically on boot.

Now, any computer you connect over ethernet will be assigned an IPv4 address (from to in this example).

Tips and Tricks

Listening on only one interface

If your computer is already part of one or several networks, it could be a problem if your computer starts giving ip addresses to machines from the other networks. In order to exclude an interface, you must create an empty declartion for the subnet that will be configured on that interface.

This is done by editing the configuration file (for example):

# No DHCP service in DMZ network (
subnet netmask {

See also