How to set up a DHCP server on a local network

DHCP stands for Dynamic Host Configuration Protocol. A DHCP server maintains IP addresses and DNS servers and a gateway address on every computer that exists on the local network. DHCP uses port 67 and 68. The DHCP server does its job like DORA:

D = Discover O = Offer R = Recover A = Acknowledgment

Here we will show you how to set up a DHCP server on Linux system.

OS : Ubuntu Server 04.14 LTS

Server IP address :

Follow the simple steps:

Step 1:

When installing ISC-DHCP Server on Linux for the first time.

                      [email protected]# sudo apt-get install isc-dhcp-server -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 0 B/411 kB of archives.
After this operation, 938 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package isc-dhcp-server.
(Reading database ... 281728 files and directories currently installed.)
Unpacking isc-dhcp-server (from .../isc-dhcp-server_4.1.1-P1-15+squeeze8_amd64.deb) ...
Processing triggers for man-db ...
Setting up isc-dhcp-server (4.1.1-P1-15+squeeze8) ...
Generating /etc/default/isc-dhcp-server...

Step 2:

Now you need to edit the main DHCP configuration file. This DHCP configuration file is located in the / etc / dhcp directory, which is named as the dhcpd.conf file

Now open the dhcpd.conf file in nano editor

                      [email protected]#nano /etc/dhcp/dhcpd.conf

Step 3:

Here we will show you how to assign on the network on the user’s computer.

Let’s open and edit the file /etc/dhcpd.conf.

You should now comment out authoritive.

                      #authoritive to authoritive

Then add some lines

                      subnet netmask {
option-dns servers
max-lease time 200

Related Posts