DHCP server

Network Guide

How to setup and use a DHCP service

The Dynamic Host Configuration Protocol service is used to issue IP addresses from a range or pool of IP Addresses from a DHCP server to a requesting DHCP Client. A Client can be a PC, Server, Mac, or mobile device. This is recommended on large network (wired or wireless), where there may be managed IP Subnets and different requirements and reduce the chance of same IP used on multiple devices (if static addresses are used).

The client sends a DHCP Discovery request for the nearest DHCP server configured on its subnet, the DHCP server responds with an offer, the DHCP Client then requests an IP address for its subnet and the server responds with an acknowledge ment and an assigned IP address.

DHCP Process

Installing DHCP on a Windows Server

  1. Open Server Manager, select Add Roles and Features.
  2. Select Role-based or feature-based installation. Next.
  3. Select server and then next.
  4. Tick DHCP Server.
  5. Add the required features.
  6. Click next twice.
  7. Click Install and then Close.
  8. Load the DHCP console, via the Tools menu.
  9. Expand server name, IPv4.
  10. Right click IPv4 and select New Scope.
  11. Enter name and description of scope.
  12. Enter start and end IP address
    1. Start IP: 10.0.3.1
    2. End IP: 10.0.3.254
    3. Length: 24
    4. Mask: 255.255.255.0

  13. Add any exclusions e.g. gateway address etc.
    1. 10.0.3.1 to 10.0.3.5
  14. Specify scope lease period. Default is 8 days.
  15. Select yes, to configure DHCP options.
  16. Enter IP address of router e.g. 10.0.3.1
  17. Enter name of parent domain e.g. mycompany.com
  18. Enter DNS server IP address.
  19. Enter any optional WINS servers (this is a legacy feature).
  20. Click Yes, to activate scope now.
  21. Click Finish

A new feature in Windows Server 2012 or later is Internet Protocol Address Management, which allows a central management of DNS and DHCP services centrally.
All changes can be managed via Server Manager, it also allows permissions to be set using role-based access controls. See Microsoft docs for more information.

Configuring DHCP on an ADSL Modem

Most ADSL modems, used in the home and in small business have a DHCP feature which allows it to allocate IP addresses over wired and wireless connections to clients.
For example, you this ADSL screen uses a single 10.0.0.0/24 subnet for any clients. The addresses 10.0.0.3 to 10.0.0.19 have been allocated for dynamic allocation. One reserved entry has been added for a network printer.

Use Router as DHCP Server: Yes
Starting IP address: 10.0.0.3
Ending IP Address: 10.0.0.19

Address Reservation:
Number: 1
IP Address: 10.0.0.6
Device Name: Brother HL-2250
MAC Address: <phsyical address of device>

DHCP on ADSL. LAN IP Setup

Installing DHCP on a Unix or Linux system

DHCP can also be installed on a Unix or Linux system, although you do not get any graphical front end to manage it. You will have to use a text editor to setup scopes and add any reservations. So, it would not be useful in a large environment, Windows DHCP would be better.

  1. Login to the server with user with administrator privileges (e.g. sudo).
  2. Install the package using whatever method suitable.
    1. A package manager.
    2. Enter apt-get update; apt-get install isc-dhcp-server (Linux Mint, Ubuntu, Debian)
    3. Enter yum update; yum install dhcp (see Centos)
  3. Configuration files can be found in /etc/dhcp.
    1. dhcpd.conf - Main configuration for for common basic options, scopes and reservations.
  4. Start the service.
    1. Sudo systemctl restart dhcp
    2. Sudo service restart dhcp
    3. Sudo service isc-dhcp-server restart