Configuring DHCP services (revision 2.1)

Introduction

This page describes how Alexis Huxley installed and configured his DHCP server.

Procedure

  1. Install the packages required for the DNS server by running:
    apt -y install isc-dhcp-server
  2. Edit /etc/default/isc-dhcp-server and set:
    INTERFACESv4="eth0"
  3. Reduce /etc/dhcp/dhcpd.conf to something like:
    ddns-update-style none;
    authoritative;
    log-facility local7;
    
    #  List known DHCP clients here
    #host halusky-eth0          { hardware ethernet dc:0e:a1:56:db:2e; fixed-address halusky.pasta.net;  }
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
        option domain-name "pasta.net";
        option domain-name-servers 192.168.1.36;
        option ntp-servers time.pasta.net;
        option routers 192.168.1.51;
    
        #  1-5 are reserved
    
        #  6-50 is for statically configured hosts
    
        #  51-100 are for statically configured network equipment
    
        #  101-150 is for known hosts (known because they're declared in 'host' stanzas above)
        pool {
            range 192.168.1.101 192.168.1.150;
            allow known-clients;
            deny unknown-clients;
        }
    
        #  151-200 is for unknown clients (unknown because they're not declared in 'host' stanzas above)
        pool {
            range 192.168.1.151 192.168.1.200;
            allow unknown-clients;
            deny known-clients;
        }
    
        #  201-254 are reserved for future use
    }
  4. Start dhcpd with:
    systemctl start isc-dhcp-server
  5. Run:
    wget -qO - http://standards-oui.ieee.org/oui/oui.txt > /usr/local/etc/oui.txt

    (Note that this URL is taken from BTS#963978..

  6. If there is an old dhcpd server on the network then stop it.
  7. Test as follows:
    1. Run:
      tail -f /var/log/messages | grep dhcpd
    2. Connect a dynamic IP host to the network.
    3. Run:
      dhcp-lease-list

      Verify the manufacturer is specified.

See also