d
An igniting portfolio theme designed
to help you leave quite a mark.
Back to Top

Install a DHCP Server Linux/Ubuntu 16.04

Installation and setup

  1. Install the DHCP server package:
     sudo apt install isc-dhcp-server
  2. Configure the file
    After installation edit the file /etc/dhcp/dhcpd.conf and confirm the following:

     ddns-update-style none;
    
     #option domain-name "example.org";
     #option domain-name-servers ns1.example.org, ns2.example.org;
    
     # define in seconds
     default-lease-time 3600;
     max-lease-time 10800;
    
     #  Primary, single network DHCP
     authoritative;
    
     subnet 192.168.28.0 netmask 255.255.255.0 {
     range 192.168.28.100 192.168.28.254;
     option domain-name-servers 192.168.28.1;
     option routers 192.168.28.1;
     }

    And finally edit the file /etc/default /isc-dhcp-server

     # network card for use by DHCP server
     INTERFACES="enp0s8"

    Start the service:

     sudo service isc-dhcp-server start
  3. Assign a fixed IP through DHCP (optional)
    Edit the file /etc/dhcp/dhcpd.conf and add the following:
    host OPcDaDiana {
    hardware ethernet 08:00:27:F4:2C:CA;
    fixed-address 192.168.28.10;
    }

Whenever configuration changes are made, the service must be restarted:

service isc-dhcp-server restart
  1. See leases (optional)
    Information on IP “leases” assigned by the server can be found at:

 

cat /var/lib/dhcp/dhcpd.leases

For more information:
https://help.ubuntu.com/lts/serverguide/dhcp.html

Credits: https://www.carrondo.net

Review and tested by: Cristiano Costa

Post a Comment