DHCP server setup

Sun 18 January 2015

[caption id="" align="alignright" width="350" class="zemanta-img"]Townhouses in Chelsea; much of this Manhattan ... neighbours' discovery (Photo credit: Wikipedia)[/caption]

My server's OS is an Archlinux, and I want to pratic a DHCP server set up both in IP v4 and IPv6


The dependencies may already be install. It only consits of dhcp, as explained on the archlinux wiki. The setup is quite forward and consist in the following steps:

  1. determine the itercase the server should serve (eth0 in my case)

  2. assign at least 1 static IP configuration to this interface any valid method. In my case, I'll use ifconfig to assign an on the network ifconfig eth0

  3. edit /etc/dhcpd.conf. The minimal config looks like:

    option domain-name-servers;
    option routers;
    subnet netmask {
    subnet netmask {

    Not having a subnet section set for each IPv4 adress set on an active interface may result on the deamon not starting. A subnet section with no directive tells the deamon to explicitly ignore this subnet.

The most explicit doc I found is the dhcpd.conf man page


The DHCP should be needed only on rare and specific occasions. The neighbour discorevy (RFC4861)


This exists (RFC3315)! I supose it is to avoid disturbing old sysadmins'habits. Or to be used in specific environnement in which knowing exactly what are the assigned addresses and to whom it has been assigned. The required steps are the same as for DHCP4, except that the config file directive have a 6 attached to them:

subnet6 2001:0DB8:f00e:eb00::/64 {
range6 2001:0DB8:f00e:eb00::1000 2001:0DB8:f00e:eb00::2000;

Neigbour discovery

You should activate the Routed Advertisement (RA, RFC2461) on each of your routers. The arch way is to use radvd. I have't dig too much as the config is very similar to the one used in freeBSD. The minimal config file (/etc/radvd.conf) looks like:

interface eth0
        AdvSendAdvert on;
        IgnoreIfMissing on;
        prefix 2001:db8:1:0::/64
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        route 2001:db0:fff::/48
                AdvRoutePreference high;
                AdvRouteLifetime 3600;



  • The dhcpd log are quite explicit when the config file is not consistent.
  • Wireshark is always a good debugging tool.
  • If you want to use a unified tool for both IPv4 ARP and IPv6 ND, the command ip neigh (man ip-neighbour) is usefull. With no other argument, it shows the content of both ARP table and neighbours table
  • Do not forget to configure a router/gateway. This post only address the automatic aacquisition of IP configuration, not routing nor firewalling

(Non-)Related articles

Related articles (or not):

Category: tools Tagged: DHCPv6 Dynamic Host Configuration Protocol IPv6 how to tools