0% found this document useful (0 votes)
127 views19 pages

DHCP

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses to clients on a network. It prevents address conflicts and simplifies network administration. When a client device requests an IP address, the DHCP server responds by assigning an unused address from its address pool. The client's configuration is then automatically updated with the correct TCP/IP settings.

Uploaded by

Satnam Kalsi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views19 pages

DHCP

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses to clients on a network. It prevents address conflicts and simplifies network administration. When a client device requests an IP address, the DHCP server responds by assigning an unused address from its address pool. The client's configuration is then automatically updated with the correct TCP/IP settings.

Uploaded by

Satnam Kalsi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

1

What is DHCP?

It gives IP Addresses Automatically to the Clients who is requesting for an IP Address Centralized IP Address Management DHCP prevents IP address Conflicts and helps conserve the use of client IP Address on the Network DHCP reduces the complexity and amount of

administrative work by assigning TCP/IP configuration Client IP configuration is updated automatically

Why DHCP ?

Static IP Assigning
IP addresses are entered manually IP address could be entered incorrectly Communication and network issues can result Frequent computer moves increase administrative effort

Dynamic IP Assigning
IP addresses are supplied automatically Correct configuration information is ensure Client configuration is updated automatically A common source of network problems is eliminated

How DHCP Server works ?

DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253


5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client

Windows Windows Client Client 192.168.0.2 192.168.0.2

5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Server works ?


DHCP Client broadcasts DHCP Client broadcasts a DHCPDISCOVER packet a DHCPDISCOVER packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254

Linux Linux Client Client

r oveer 9b i ic ov - -d 9b DDssc 2cc11d a2 P HC P 77-3 a fff DD HC5eecc--3ffff-ff-ffff : : 5 ffff ff-ff f rrm FFoomToo: : ff T

5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Windows Windows Client Client 192.168.0.2 192.168.0.2

5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Server works ?


DHCP Server broadcast DHCP Server broadcast IP address Pool a DHCPOFFER packet a DHCPOFFER packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
192.168.0.1 192.168.0.2 192.168.0.3

5e7c-3a2c-1d9a 192.168.0.100 5e7c-3a2c-1d9a


FFro D T ro m D H To o :m : : 5 HCCP OOffe : 5 5e 5e e7 P O ffe r e 7 7 c- O ff r I IP 7c c-3c-33a ffe er P : -3 a2 a2 2c r : 1 19 a2 c c -1 92 2.1 c-1-1d-1dd9 .16 68 d 9b 9a a 8.0.0. 9b .1 1

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client

Windows Windows Client Client 192.168.0.2 192.168.0.2

5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Server works ?

DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253


5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

DHCP Server broadcast DHCP Server broadcast a DHCPOFFER packet a DHCPOFFER packet
IP address Pool 192.168.0.101 192.168.0.102

DHCP DHCP Server2 Server2

192.168.0.254 192.168.0.103 192.168.0.254


er 5e7c-3a2c-1d9d 5e7c-3a2c-1d9d DH CPP Offffer 9d DHC O c-1d d 192.168.0.254 -3a2 -1d9 From : :5e7c -3a21d9b 5e7c c-c From 7c-3a2 c-1d9b Too: :5e 7c-3a2 8.0.101 T 5e 2.16 0.101 er IP 19 O fffferIP : :19 2.168. Windows O Windows

Linux Linux Client Client

Client Client

192.168.0.2 192.168.0.2
5e7c-3a2c-1d9b 5e7c-3a2c-1d9b 5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Server works ?


DHCP Client broadcasts DHCP Client broadcasts a DHCPREQUEST packet a DHCPREQUEST packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client

t esst 9b equue - - d b RReqa2cc11d99a P HC P c-3 a2 -d 9a f DDHC5e77c-3a2c-11d oof e : : 5e c-33a2c asse r r m e7 - r e a .1 FFoom: 55e7tcfoorLLe .00.1 oo : es t f .1688. TT u s 2 .16 eq e 9 RR eqIu : :1192 PP I

Windows Windows Client Client 192.168.0.2 192.168.0.2

5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Server works ?


DHCP Server broadcasts DHCP Server broadcasts IP address Pool a DHCPACK packet a DHCPACK packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
192.168.0.1 6 Hrs 192.168.0.2 192.168.0.3

5e7c-3a2c-1d9a 192.168.0.100 5e7c-3a2c-1d9a


ro m D H RRep TTo m : HCCP ep ly o : : 5e P ly w : 5 5e 5e 7c OO wi ith e7 7c 7c -3 ffffe a IPIP : th 6 6 Hc-3-3a -3a2 2cer r : 1 19 Ho ou a2 2c- c- -1 92 2.1 u rs c-1 1d 1dd9 .16 68 rs L d 9b 9a a e 8.0.0. Lea as9b .1 1 se e f fo or r

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client 192.168.0.1 192.168.0.1


5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

FFro

Windows Windows Client Client 192.168.0.2 192.168.0.2


5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

How DHCP Lease Renewal works ?


DHCP Client sends DHCP Client sends a DHCPREQUEST packet a DHCPREQUEST packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client 192.168.0.1 192.168.0.1


5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

Request to Extend Lease of Request to Extend Lease of IP : :192.168.0.1 IP 192.168.0.1

DHCP Request DHCP Request From : :5e7c-3a2c-1d9b From 5e7c-3a2c-1d9b To : :5e7c-3a2c-1d9a To 5e7c-3a2c-1d9a

Windows Windows Client Client 192.168.0.2 192.168.0.2


5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

50%

10

How DHCP Lease Renewal works ?


DHCP Server sends DHCP Server sends IP address Pool a DHCPACK packet a DHCPACK packet DHCP DHCP Server1 Server1 192.168.0.253 192.168.0.253
192.168.0.1 3 Hrs 9 192.168.0.2 192.168.0.3

5e7c-3a2c-1d9a 192.168.0.100 5e7c-3a2c-1d9a DHCP Offer DHCP Offer From : :5e7c-3a2c-1d9a From 5e7c-3a2c-1d9a To : :5e7c-3a2c-1d9b To 5e7c-3a2c-1d9b

DHCP DHCP Server2 Server2 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Extend Lease by 66Hours for Extend Lease by Hours for IP : :192.168.0.1 IP 192.168.0.1

Linux Linux Client Client 192.168.0.1 192.168.0.1


5e7c-3a2c-1d9b 5e7c-3a2c-1d9b 150% 50%

Windows Windows Client Client 192.168.0.2 192.168.0.2


5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

11

Why DHCP Reservation?

Assigning IP address dynamically has some problems that every time a client system boots it is not sure that it will get the same IP so it will be uneasy task for other systems to find the particular system. To solve the above problem we can do mac-address binding of the IP s. Just give its entry in the fixedaddress portion.

12

Requirements

Packages dhcp* Port Numbers 67 68 Bootp DHCP

Configuration File /etc/dhcpd.conf Service dhcpd Daemon dhcpd

13

DHCP Server Configuration

DHCP DHCP Server Server 192.168.0.253 192.168.0.253


5e7c-3a2c-1d9a 5e7c-3a2c-1d9a

Web Web Server Server 192.168.0.254 192.168.0.254


5e7c-3a2c-1d9d 5e7c-3a2c-1d9d

Linux Linux Client Client


5e7c-3a2c-1d9b 5e7c-3a2c-1d9b

Windows Windows Client Client


5e7c-3a2c-1d9c 5e7c-3a2c-1d9c

14

Configuring DHCP Server

Install the package by using one of the installation methods Install the package by using one of the installation methods [root@comp1 ~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt [root@comp1 ~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt [root@comp1 ~]# cd /mnt [root@comp1 ~]# cd /mnt [root@comp1 ~]# rpm -ivh dhcp* --force --aid [root@comp1 ~]# rpm -ivh dhcp* --force --aid

Sample configuration file location Sample configuration file location /usr/share/doc/dhcp3.0.1/dhcpd.conf.sample /usr/share/doc/dhcp3.0.1/dhcpd.conf.sample Copying Sample file for Configuration Copying Sample file for Configuration [root@comp1 ~]# cp /usr/share/doc/dhcp3.0.1/dhcpd.conf.sample [root@comp1 ~]# cp /usr/share/doc/dhcp3.0.1/dhcpd.conf.sample /etc/dhcpd.conf /etc/dhcpd.conf

15

/etc/dhcpd.conf

To change the range and other options To change the range and other options default-lease-time 21600; default-lease-time 21600; subnet 192.168.0.0 netmask 255.255.255.0 { subnet 192.168.0.0 netmask 255.255.255.0 { option routers 192.168.0.254; option routers 192.168.0.254; option subnet-mask 255.255.255.0; option subnet-mask 255.255.255.0; option domain-name zoom.com"; option domain-name zoom.com"; option domain-name-servers 192.168.0.253; option domain-name-servers 192.168.0.253; range 192.168.0.1 192.168.0.100; } range 192.168.0.1 192.168.0.100; } To bind mac-address to IP address To bind mac-address to IP address host server2 { host server2 { option host-name server2.zoom.com"; option host-name server2.zoom.com"; hardware ethernet 5E:7C:3A:2C:1D:9D; hardware ethernet 5E:7C:3A:2C:1D:9D; fixed-address 192.168.0.254; } fixed-address 192.168.0.254; }

16

DHCP Server

To restart the DHCP services To restart the DHCP services [root@comp1 ~]# service dhcpd restart [root@comp1 ~]# service dhcpd restart

17

DHCP Client

Linux

Install the package by using one of the installation methods Install the package by using one of the installation methods [root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat /RPMS/ [root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat /RPMS/ /mnt /mnt [root@comp1 ~]# cd /mnt [root@comp1 ~]# cd /mnt [root@comp1 ~]# rpm -ivh dhclient* --force --aid [root@comp1 ~]# rpm -ivh dhclient* --force --aid

To get IP address from DHCP server To get IP address from DHCP server [root@comp1~]# dhclient [root@comp1~]# dhclient or or [root@comp1 ~]# netconfig [root@comp1 ~]# netconfig Check the box use dynamic IP configuration Check the box use dynamic IP configuration

18

DHCP Client

Windows

Configuring DHCP Client Configuring DHCP Client Select My Network Places .. Select My Network Places Right click Properties .. Right click Properties Select Local Area Connection Select Local Area Connection Right click Properties .. Right click Properties Double Click Internet Protocol (TCP/IP) Double Click Internet Protocol (TCP/IP) Select Option Obtain an IP Address automatically Select Option Obtain an IP Address automatically

19

You might also like