SlideShare a Scribd company logo
Dynamic Host Configuration Protocol (DHCP)
Why Use DHCP?  D ynamic  H ost  C onfiguration  P rotocol  ( DHCP ) is network protocol for  automatically assigning TCP/IP  information to client machines.  DHCP is useful for fast delivery of client network configuration . When configuring the client system, the administrator can choose DHCP and not have to enter an IP address, netmask, gateway, or DNS servers. The client retrieves this information from the DHCP server.  DHCP is also useful if an administrator wants to change the IP addresses of a large number of systems . Instead of reconfiguring all the systems, he can just edit one DHCP configuration file on the server for the new set of IP address. If the DNS servers for an organization changes, the changes are made on the DHCP server, not on the DHCP clients. Once the network is restarted on the clients (or the clients are rebooted), the changes will take effect.
DHCP Operations MAC:   Known IP:  Unknown DHCP Discover UDP Broadcast DHCP Offer UDP Broadcast IP 1 IP 2 IP 3 DHCP Request DHCP Ack IP Address Gateway IP of servers And more … DHCP server
Configuring a DHCP Server  You can configure a DHCP server using the configuration file  /etc/dhcpd.conf .  DHCP also uses the file / var/lib/dhcp/dhcpd.leases  to store the client lease database. This file should not be modified by hand . DHCP lease information for each recently  assigned IP  address is automatically stored in the lease database. The information includes the  length   of   the   lease , to whom the IP address has been assigned, the  start  and  end   dates  for the lease, and the  MAC   address  of the network interface card that was used to retrieve the lease  Many RPM packages don't automatically install a / etc/dhcpd.conf  file, but you can find a sample copy of dhcpd.conf in the following directory which you can always use as a guide: /usr/share/doc/dhcp- <version-number> /dhcpd.conf.sample   #  cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample  \ /etc/dhcpd.conf
/etc/dhcpd.conf add the following line to the top of the configuration file : ddns-update-style interim  #  Redhat Version 8.0+ ignore client-updates      #  Fedora Core 1+ There are two types of statements in the configuration file:  Parameters  — state how to perform a task, whether to perform a task, or what network configuration options to send to the client. Declarations  — describe the topology of the network, describe the clients, provide addresses for the clients, or apply a group of parameters to a group of declarations. Some parameters must start with the  option  keyword and are referred to as options.
/etc/dhcpd.conf the  routers ,  subnet-mask ,  domain-name ,  domain-name-servers , and  time-offset  options are used for any host statements declared below it  You must include a  subnet  declaration for every subnet in your network.  If you do not, the DHCP server will fail to start   Clients are assigned an IP address within the  range   To assign an IP address to a client based on the MAC address of the network interface card, use the  hardware   ethernet  parameter within a  host  declaration.
/etc/dhcpd.conf ddns-update-style interim  # Redhat Version 8.0+ subnet 192.168.1.0 netmask 255.255.255.0   {    # The range of IP addresses the server will issue to    #DHCP enabled PC clients  booting up on the network range 192.168.1.10 192.168.1.100; range 192.168.1.201 192.168.1.220;    # Set the amount of time in seconds that # a client may keep the IP address default-lease-time 86400; max-lease-time 86400; # Set the default gateway to be used by # the PC clients option routers 192.168.1.1;   # Don't forward DHCP requests from this # NIC interface to any other NIC interfaces option ip-forwarding off;
/etc/dhcpd.conf # Set the broadcast address and subnet mask # to be used by the DHCP clients option broadcast-address 192.168.1.255; option subnet-mask 255.255.255.0; # Set the DNS server to be used by the  DHCP clients option domain-name-servers 192.168.1.100; # If you specify a WINS server for your Windows clients, # you need to include the following option in the dhcpd.conf file: option netbios-name-servers 192.168.1.100; } # You can also assign specific IP addresses based on the    #clients' ethernet MAC address (Host's name is &quot;smallfry“): host smallfry { hardware ethernet 08:00:2b:4c:59:23;   fixed-address 192.168.1.222; }
Starting and Stopping the Server  Before you start the DHCP server for the first time, it will fail unless there is an existing dhcpd.leases file. To create the file if it does not exist, use the command  # touch /var/lib/dhcp/dhcpd.leases  If you have more than one network interface attached to the system, but you only want the DHCP server to start on one of the interface, you can configure the DHCP server to start only on that device. In /etc/sysconfig/dhcpd, add the name of the interface to the list of DHCPDARGS:  DHCPDARGS= eth0 Use the chkconfig command to get DHCP configured to start at boot: # chkconfig dhcpd on  Use the /etc/init.d/dhcpd script to start/stop/restart DHCP after booting  # / etc/init.d/dhcpd   start # / etc/init.d/dhcpd   stop # / etc/init.d/dhcpd   restart
DHCP Relay Agent  The DHCP Relay Agent ( dhcrelay ) allows you to relay DHCP and BOOTP requests from a subnet with no DHCP server on it to one or more DHCP servers on other subnets.  When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. When a DHCP server returns a reply, the reply is broadcast or unicast on the network that sent the original request.  The DHCP Relay Agent listens for DHCP requests on all interfaces unless the interfaces are specified in / etc/sysconfig/dhcrelay  with the  INTERFACES  directive.  INTERFACES=eth0  DHCPSERVERS=192.168.10.1 To start the DHCP Relay Agent, use the command # / etc/init.d/ dhcrelay   start .

More Related Content

PPTX
Dhcp Server Linux Server
PDF
Dhcp confg
PPT
IPTABLES
PPS
Linux05 DHCP Server
PPT
Configuration DHCP
PPT
PPT
DHCP Protocol
PPTX
Dhcp Server Linux Server
Dhcp confg
IPTABLES
Linux05 DHCP Server
Configuration DHCP
DHCP Protocol

What's hot (20)

PPTX
PPTX
6 understanding DHCP
PPTX
Dhcp ppt
PPTX
Tutorial on dhcp
PPT
Dhcp presentation 01
PPTX
Configuring Dhcp Server, Scopes &amp; Superscopes
PPTX
Dhcp windows server 2012
PPT
Dhcp by lalit bhati
PPT
Dynamic Host Configuration Protocol
PPT
Wintel ppt for dhcp
PPT
DHCP Server & Client Presentation
PDF
DHCP (dynamic host configuration protocol)
PPT
dynamic host configuration protocol
PPTX
Bootstrapping with bootp and dhcp
PPSX
Lesson 6: Dynamic Host Configuration Protocol A
PPT
PPT
Dhcp presentation
6 understanding DHCP
Dhcp ppt
Tutorial on dhcp
Dhcp presentation 01
Configuring Dhcp Server, Scopes &amp; Superscopes
Dhcp windows server 2012
Dhcp by lalit bhati
Dynamic Host Configuration Protocol
Wintel ppt for dhcp
DHCP Server & Client Presentation
DHCP (dynamic host configuration protocol)
dynamic host configuration protocol
Bootstrapping with bootp and dhcp
Lesson 6: Dynamic Host Configuration Protocol A
Dhcp presentation
Ad

Viewers also liked (9)

PDF
Dhcp commandas
PPT
DLNA for Dummies
PPT
PPTX
Domain Name System
PPTX
DNS server configuration
PPTX
Basics about IP address, DNS and DHCP.
PPTX
Types of Servers - Basic Differences
PPT
Dns ppt
PPT
Active Directory Training
Dhcp commandas
DLNA for Dummies
Domain Name System
DNS server configuration
Basics about IP address, DNS and DHCP.
Types of Servers - Basic Differences
Dns ppt
Active Directory Training
Ad

Similar to Lession4 Dhcp (20)

PDF
dhcp.pdf
DOCX
Networking DHCP server Setup Reports
PPT
PPTX
Dhcp Configuration File
PDF
DHCP concept
PPTX
Dhcp server configuration
PDF
DHCP in windows server 2012
ODP
Dhcpsession
PDF
Installing and configuring a dhcp on windows server 2016 step by step
PPTX
dynamichost configuration protocol
PDF
Dhcp
DOCX
Installing the dhcp server role
DOCX
DHCP Server Guaidlines using CISCO PACKET TRACER
PPT
Linux lecture9
PPTX
DHCP(In_Linux).pptx
PPTX
Module (8) DHCP Server.pptx
PPTX
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
PPTX
Dynamic Host Configuration Protocol ( DHCP).pptx
PPT
Durai presentation of dhcp
dhcp.pdf
Networking DHCP server Setup Reports
Dhcp Configuration File
DHCP concept
Dhcp server configuration
DHCP in windows server 2012
Dhcpsession
Installing and configuring a dhcp on windows server 2016 step by step
dynamichost configuration protocol
Dhcp
Installing the dhcp server role
DHCP Server Guaidlines using CISCO PACKET TRACER
Linux lecture9
DHCP(In_Linux).pptx
Module (8) DHCP Server.pptx
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
Dynamic Host Configuration Protocol ( DHCP).pptx
Durai presentation of dhcp

More from leminhvuong (20)

PPTX
PPT
Lession2 Xinetd
PPT
Module 7 Sql Injection
PPT
Iptables
PPT
Lession1 Linux Preview
PPT
PPT
PPT
Net Admin Intro
PPT
Lession3 Routing
PPT
Module 1 Introduction
PPT
Wire Less
PPT
Net Security Intro
PPT
Module 10 Physical Security
PPT
Module 9 Dos
PPT
Module 8 System Hacking
PPT
Module 6 Session Hijacking
PPT
Module 5 Sniffers
PPT
Module 4 Enumeration
PPT
Module 3 Scanning
PPT
Module 2 Foot Printing
Lession2 Xinetd
Module 7 Sql Injection
Iptables
Lession1 Linux Preview
Net Admin Intro
Lession3 Routing
Module 1 Introduction
Wire Less
Net Security Intro
Module 10 Physical Security
Module 9 Dos
Module 8 System Hacking
Module 6 Session Hijacking
Module 5 Sniffers
Module 4 Enumeration
Module 3 Scanning
Module 2 Foot Printing

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...

Lession4 Dhcp

  • 1. Dynamic Host Configuration Protocol (DHCP)
  • 2. Why Use DHCP? D ynamic H ost C onfiguration P rotocol ( DHCP ) is network protocol for automatically assigning TCP/IP information to client machines. DHCP is useful for fast delivery of client network configuration . When configuring the client system, the administrator can choose DHCP and not have to enter an IP address, netmask, gateway, or DNS servers. The client retrieves this information from the DHCP server. DHCP is also useful if an administrator wants to change the IP addresses of a large number of systems . Instead of reconfiguring all the systems, he can just edit one DHCP configuration file on the server for the new set of IP address. If the DNS servers for an organization changes, the changes are made on the DHCP server, not on the DHCP clients. Once the network is restarted on the clients (or the clients are rebooted), the changes will take effect.
  • 3. DHCP Operations MAC: Known IP: Unknown DHCP Discover UDP Broadcast DHCP Offer UDP Broadcast IP 1 IP 2 IP 3 DHCP Request DHCP Ack IP Address Gateway IP of servers And more … DHCP server
  • 4. Configuring a DHCP Server You can configure a DHCP server using the configuration file /etc/dhcpd.conf . DHCP also uses the file / var/lib/dhcp/dhcpd.leases to store the client lease database. This file should not be modified by hand . DHCP lease information for each recently assigned IP address is automatically stored in the lease database. The information includes the length of the lease , to whom the IP address has been assigned, the start and end dates for the lease, and the MAC address of the network interface card that was used to retrieve the lease Many RPM packages don't automatically install a / etc/dhcpd.conf file, but you can find a sample copy of dhcpd.conf in the following directory which you can always use as a guide: /usr/share/doc/dhcp- <version-number> /dhcpd.conf.sample   # cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample \ /etc/dhcpd.conf
  • 5. /etc/dhcpd.conf add the following line to the top of the configuration file : ddns-update-style interim # Redhat Version 8.0+ ignore client-updates      # Fedora Core 1+ There are two types of statements in the configuration file: Parameters — state how to perform a task, whether to perform a task, or what network configuration options to send to the client. Declarations — describe the topology of the network, describe the clients, provide addresses for the clients, or apply a group of parameters to a group of declarations. Some parameters must start with the option keyword and are referred to as options.
  • 6. /etc/dhcpd.conf the routers , subnet-mask , domain-name , domain-name-servers , and time-offset options are used for any host statements declared below it You must include a subnet declaration for every subnet in your network. If you do not, the DHCP server will fail to start Clients are assigned an IP address within the range To assign an IP address to a client based on the MAC address of the network interface card, use the hardware ethernet parameter within a host declaration.
  • 7. /etc/dhcpd.conf ddns-update-style interim # Redhat Version 8.0+ subnet 192.168.1.0 netmask 255.255.255.0 {   # The range of IP addresses the server will issue to #DHCP enabled PC clients booting up on the network range 192.168.1.10 192.168.1.100; range 192.168.1.201 192.168.1.220;   # Set the amount of time in seconds that # a client may keep the IP address default-lease-time 86400; max-lease-time 86400; # Set the default gateway to be used by # the PC clients option routers 192.168.1.1; # Don't forward DHCP requests from this # NIC interface to any other NIC interfaces option ip-forwarding off;
  • 8. /etc/dhcpd.conf # Set the broadcast address and subnet mask # to be used by the DHCP clients option broadcast-address 192.168.1.255; option subnet-mask 255.255.255.0; # Set the DNS server to be used by the DHCP clients option domain-name-servers 192.168.1.100; # If you specify a WINS server for your Windows clients, # you need to include the following option in the dhcpd.conf file: option netbios-name-servers 192.168.1.100; } # You can also assign specific IP addresses based on the #clients' ethernet MAC address (Host's name is &quot;smallfry“): host smallfry { hardware ethernet 08:00:2b:4c:59:23; fixed-address 192.168.1.222; }
  • 9. Starting and Stopping the Server Before you start the DHCP server for the first time, it will fail unless there is an existing dhcpd.leases file. To create the file if it does not exist, use the command # touch /var/lib/dhcp/dhcpd.leases If you have more than one network interface attached to the system, but you only want the DHCP server to start on one of the interface, you can configure the DHCP server to start only on that device. In /etc/sysconfig/dhcpd, add the name of the interface to the list of DHCPDARGS: DHCPDARGS= eth0 Use the chkconfig command to get DHCP configured to start at boot: # chkconfig dhcpd on  Use the /etc/init.d/dhcpd script to start/stop/restart DHCP after booting  # / etc/init.d/dhcpd start # / etc/init.d/dhcpd stop # / etc/init.d/dhcpd restart
  • 10. DHCP Relay Agent The DHCP Relay Agent ( dhcrelay ) allows you to relay DHCP and BOOTP requests from a subnet with no DHCP server on it to one or more DHCP servers on other subnets. When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. When a DHCP server returns a reply, the reply is broadcast or unicast on the network that sent the original request. The DHCP Relay Agent listens for DHCP requests on all interfaces unless the interfaces are specified in / etc/sysconfig/dhcrelay with the INTERFACES directive. INTERFACES=eth0 DHCPSERVERS=192.168.10.1 To start the DHCP Relay Agent, use the command # / etc/init.d/ dhcrelay start .