SlideShare a Scribd company logo
2
Most read
3
Most read
10
Most read
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

What's hot (20)

PPTX
Basics about IP address, DNS and DHCP.
abhishek bhandare
 
PPTX
Subnetting Presentation
Touhidul Fahim
 
PPT
Dhcp presentation 01
maverick4489
 
PDF
DNS (Domain Name System)
Shashidhara Vyakaranal
 
PPTX
Dns(Domain name system)
Fâhém Ähmêd
 
PDF
Intro to DNS
ThousandEyes
 
PPTX
Presentation on samba server
Veeral Bhateja
 
PPT
Domain Name System
ABDUL GAFOOR K V
 
PPT
active-directory-domain-services
202066
 
PPTX
1 introduction to windows server 2016
Hameda Hurmat
 
PPTX
Domain Name System DNS
Akshay Tiwari
 
PPTX
Subnetting made simple
Wamuyu Murakaru
 
PDF
Network Address Translation (NAT)
Joud Khattab
 
PPT
Vlan
sanss40
 
PPT
Network servers
Online
 
PPT
dynamic host configuration protocol
kinish kumar
 
PPT
Samba server
Santosh Khadsare
 
PPTX
Network address translation
Mohak Kaushik
 
PPT
Mail server
Jazib Amjad
 
Basics about IP address, DNS and DHCP.
abhishek bhandare
 
Subnetting Presentation
Touhidul Fahim
 
Dhcp presentation 01
maverick4489
 
DNS (Domain Name System)
Shashidhara Vyakaranal
 
Dns(Domain name system)
Fâhém Ähmêd
 
Intro to DNS
ThousandEyes
 
Presentation on samba server
Veeral Bhateja
 
Domain Name System
ABDUL GAFOOR K V
 
active-directory-domain-services
202066
 
1 introduction to windows server 2016
Hameda Hurmat
 
Domain Name System DNS
Akshay Tiwari
 
Subnetting made simple
Wamuyu Murakaru
 
Network Address Translation (NAT)
Joud Khattab
 
Vlan
sanss40
 
Network servers
Online
 
dynamic host configuration protocol
kinish kumar
 
Samba server
Santosh Khadsare
 
Network address translation
Mohak Kaushik
 
Mail server
Jazib Amjad
 

Viewers also liked (20)

PPTX
Dhcp ppt
Hema Dhariwal
 
PPT
DHCP Server & Client Presentation
raini
 
PPTX
Dhcp
Sandeep Kamath
 
PPT
IPTABLES
Tan Huynh Cong
 
PPT
Apache HTTP Server
Tan Huynh Cong
 
PPTX
Tutorial on dhcp
Salah Amean
 
PPSX
Linux02 install SSh
Jainul Musani
 
PPT
Wintel ppt for dhcp
duraimurugan89
 
PPT
Dhcp
tameemyousaf
 
PPT
Samba
tmavroidis
 
PPT
Dns
tmavroidis
 
PPT
Domain name system
Siddique Ibrahim
 
PPT
Dns ppt
Mauood Hamidi
 
PPT
Basic Linux
Tan Huynh Cong
 
PPT
Routing
Tan Huynh Cong
 
PPT
TCP WRAPPERS and XINETD
Tan Huynh Cong
 
PPT
A427 nic card
surajbhai
 
PPT
Diva23
diva23
 
PPT
Mysql
TSUBHASHRI
 
Dhcp ppt
Hema Dhariwal
 
DHCP Server & Client Presentation
raini
 
IPTABLES
Tan Huynh Cong
 
Apache HTTP Server
Tan Huynh Cong
 
Tutorial on dhcp
Salah Amean
 
Linux02 install SSh
Jainul Musani
 
Wintel ppt for dhcp
duraimurugan89
 
Samba
tmavroidis
 
Domain name system
Siddique Ibrahim
 
Dns ppt
Mauood Hamidi
 
Basic Linux
Tan Huynh Cong
 
TCP WRAPPERS and XINETD
Tan Huynh Cong
 
A427 nic card
surajbhai
 
Diva23
diva23
 
Mysql
TSUBHASHRI
 
Ad

Similar to Configuration DHCP (20)

PDF
Dhcp confg
Rincy Ranjith
 
PDF
dhcp.pdf
TekashiAi
 
DOCX
Networking DHCP server Setup Reports
Jiaul Hasan Jony
 
PPT
DHCP
ssusered887b
 
PPT
DHCP Protocol
Mohammed Hisham
 
PPTX
Dhcp Configuration File
Shubhamg Gupta
 
PDF
DHCP concept
Shopnomoy Prantor
 
PPTX
Dhcp server configuration
UttamAgarwal9
 
PDF
DHCP in windows server 2012
Abaady Sahal
 
ODP
Dhcpsession
guest648519
 
PDF
Installing and configuring a dhcp on windows server 2016 step by step
Ahmed Abdelwahed
 
PPTX
dynamichost configuration protocol
rajisri2
 
PDF
Dhcp
Md Shihab
 
DOCX
Installing the dhcp server role
muneerepckd
 
DOCX
DHCP Server Guaidlines using CISCO PACKET TRACER
COMSATS Institute of Information Technology
 
PPT
Linux lecture9
gkj021
 
PPT
Dhcp presentation
Saqib Malik
 
PPTX
Configuring Dhcp Server, Scopes &amp; Superscopes
jocelyn_tanner
 
PPTX
DHCP(In_Linux).pptx
ShanmugapriyaSenthil3
 
PPTX
Module (8) DHCP Server.pptx
GeorgeThoreJr
 
Dhcp confg
Rincy Ranjith
 
dhcp.pdf
TekashiAi
 
Networking DHCP server Setup Reports
Jiaul Hasan Jony
 
DHCP Protocol
Mohammed Hisham
 
Dhcp Configuration File
Shubhamg Gupta
 
DHCP concept
Shopnomoy Prantor
 
Dhcp server configuration
UttamAgarwal9
 
DHCP in windows server 2012
Abaady Sahal
 
Dhcpsession
guest648519
 
Installing and configuring a dhcp on windows server 2016 step by step
Ahmed Abdelwahed
 
dynamichost configuration protocol
rajisri2
 
Dhcp
Md Shihab
 
Installing the dhcp server role
muneerepckd
 
DHCP Server Guaidlines using CISCO PACKET TRACER
COMSATS Institute of Information Technology
 
Linux lecture9
gkj021
 
Dhcp presentation
Saqib Malik
 
Configuring Dhcp Server, Scopes &amp; Superscopes
jocelyn_tanner
 
DHCP(In_Linux).pptx
ShanmugapriyaSenthil3
 
Module (8) DHCP Server.pptx
GeorgeThoreJr
 
Ad

Recently uploaded (20)

PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
July Patch Tuesday
Ivanti
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 

Configuration 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 .