Open In App

Installation and configuration of DHCP server on UBUNTU

Last Updated : 30 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

A network technology called Dynamic Host Configuration technology (DHCP) allows the host of all the systems to receive IP addresses and associated network configurations automatically from an internal server. It makes using services like DNS, NTP, and any UDP or TCP-based communication protocol possible for devices by automating the system configuration procedure on IP networks.

In this article, we'll explore how to install and configure a DHCP server on Ubuntu.

How to Install and Configure a DHCP server on Ubuntu?

A DHCP server assigns an IP address to a DHCP client on a "lease" basis; the length of the lease often changes based on the system or how long a client computer is expected to need the connection or DHCP setup. Follow the below-mentioned easy steps to install and configure a DHCP server on the Ubuntu operating system.

Step 1: Install the DHCP server in Ubuntu OS

  • Run the below-structured command to install the DHCP server package or dhcp3-server.
$ sudo apt install isc-dhcp-server
apt-install-dhcp-server
  • Complete the installation process > Edit the internal file "/etc/default/isc-dhcp-server" with the INTERFACES option, and specify which interfaces DHCPD should utilize to fulfill DHCP queries.

Let's an example, configure it as follows to allow the DHCPD daemon to listen on 'eth1':

INTERFACES="eth1"

Step 2: Configure the DHCP server in Ubuntu OS

  • Add all the network information to the main DHCP configuration file "/etc/enable/dhcpd.conf"
$ sudo vi /etc/dhcp/dhcpd.conf 

The DHCP configuration file defines two different kinds of statements, which are:

  1. Internal parameters: Try to tell the DHCP client what network configuration choices to provide, how to execute a task, and whether to execute it at all.
  2. Overall declarations: All can apply a set of parameters to a group of declarations, specify the clients, state the network topology, or provide addresses for the clients.
  • Set the below-mentioned global parameters at the top of the file -
option domain-name "system.lan";
option domain-name-servers ns1.system.lan, ns2.system.lan;
default-lease-time 2400;
max-lease-time 4800;
authoritative;
  • Define a proper subnetwork like 192.168.10.0/24 LAN network
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-search "system.lan";
option domain-name-servers 192.168.1.1;
range 192.168.1.10 192.168.1.100;
range 192.168.1.110 192.168.1.200;
}

Conclusion

It is possible to install and configure a DHCP server to effectively handle IP address allocation in the local network by following the instructions provided in this article or steps. Every local network needs DHCP, and being able to set up and manage efficiently a DHCP server is a fundamental ability for any network administrator system. When the required network devices are configured and verified correctly, the relevant network configurations are immediately sent to the located system to enable a seamless communication process.

Also Read


Next Article
Article Tags :

Similar Reads