Nothing Special   »   [go: up one dir, main page]

DHCP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Royal University of Phnom Penh

DHCP SERVER
LECTURER: Houn Seak
SUBJECT: LSA
CLASS: A2
MEMBER: Sao Sotheara, Sor Tola, Phall Buntheoun,
Hong Senghour, Rourn Sothearak
Content

1.Definition and Processing


2. Setup
3. Configuration
4. How DHCP work
5. Advantage and Disadvantage
6. Conclusion

2
1. Definition

Dynamic Host Configuration Protocol is a network management protocol


that is used to dynamically assign the IP address and other information to
each host on the network so that they can communicate efficiently. DHCP
automates and centrally manages the assignment of IP address easing the
work of network administrator. In addition to the IP address, the DHCP also
assigns the subnet masks, default gateway and domain name server(DNS)
address and other configuration to the host and by doing so, it makes the task
of network administrator easier.

3
Process of DHCP Server
There are 4 steps in DHCP Server

1. When a new system or computer connect


to a network it searches the DHCP server
in a network. As it does not have an IP
address so it does not find a DHCP
server, so it sends the DHCP to discover
messages to all the devices connected to
the network. This process is known as
Broadcasting.
2. When the DHCP server receives the DHCP discover message sent by the
new system or client, then the DHCP server offers an IP address and broadcast
it to all the connected devices.

3. The client computer or system receives the IP address and then it broadcasts
the request that it has accepted the IP address on the network.

4. Then the DHCP server acknowledges the client system that it can now use
the assigned IP address.

5
2. Installing DHCP Server

To install the DHCP server on the Linux VM firstly, you'll need


to update the packages repository by executing the following
command.
$ sudo apt-get update
After updating the packages' list, install the DHCP package
using the following command.
$ sudo apt-get install isc-dhcp-server -y

6
Configuring a DHCP Server
After the installation of the DHCP server, you'll want to get the IP
address of the DHCP server using the ifconfig command.
Executing this command will result in

the IP address (192.168.110.1).

The DHCP configuration file is located at /etc/dhcp/dhcpd.conf.


Run the following command to open the file.
$ sudo nano /etc/dhcp/dhcpd.conf

7
Defining a subnet to use
Add the following lines in the configuration file to define
the subnet, range of IP addresses, domain and domain name servers.
subnet 192.168.110.0 netmask 255.255.255.0 {

8
DHCP Global Configurations
To set up a DHCP server, execute the following steps to configure the
global settings.

Step 1: To specify the default and maximum lease time, find the
parameters default-lease-time and max-lease- time in the
configuration file and change their values as shown below.

default-lease-time 600;

max-lease-time 7200;

9
Step 2: In case of multiple interfaces, define which interface the
DHCP server should use to serve DHCP requests. In the
configuration file, find and edit the value of INTERFACESv4 to
update it with the preferred interface to serve the requests.
INTERFACESv4="eth0"
Step 3: To make DHCP server the official DHCP server for the
clients, uncomment the following line in the configuration file by
removing the # character as shown below.
$ authoritative;
After implementing the preceding basic configuration, you'll
need to save and close the configuration file.

10
4. How do DHCP work?
DHCP works at the application layer to dynamically assign the IP address to the client
and this happens through the exchange of a series of messages called DHCP
transactions or DHCP conversation.
✗ DHCP Discovery: The DHCP client broadcast messages to discover the DHCP servers. The client
computer sends a packet with the default broadcast destination of 255.255.255.255 or the
specific subnet broadcast address if any configured.

11
✗ DHCP Offer: When the DHCP server receives the DHCP Discover message then it suggests or
offers an IP address(form IP address pool) to the client by sending a DHCP offer message to the
client. This DHCP offer message contains the proposed IP address for DHCP client, IP address of
the server, MAC address of the client, subnet mask, default gateway, DNS address, and lease
information.

12
✗ DHCP Request: In most cases, the client can receive multiple DHCP offer because in a network there are many
DHCP servers(as they provide fault tolerance). If the IP addressing of one server fails then other servers can
provide backup. But, the client will accept only one DHCP offer.

13
✗ DHCP Acknowledgment: DHCP server send IP address to the host.

14
Advantage
• It is easy to implement and automatic assignment of an IP address means an
accurate IP address.
• The manual configuration of the IP address is not required. Hence, it saves time
and workload for the network administrators.
• Duplicate or invalid IP assignments are not there which means there is no IP
address conflict.
• it is a great benefit for mobile users as the new valid configurations are
automatically obtained when they change their network.

15
Disvantage
• As the DHCP servers have no secure mechanism for the authentication of the client
so any new client can join the network. This posses security risks like unauthorized
clients being given IP address and IP address depletion from unauthorized clients.
• The DHCP server can be a single point of failure if the network has only one
DHCP server.

16
Conclusion

DHCP is a network protocol that enables a server to automatically


assign an IP address to a computer from a defined range of numbers
configured for a given network. DHCP assigns an IP address when a
system is started.

17

You might also like