Skip to main content

DHCP(Dynamic Host Configuration Protocol)

  

DHCP(Dynamic Host Configuration Protocol)

The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks, whereby a DHCP server dynamically assigns an IP address and other network configuration parameters to each device on the network, so they can communicate with other IP networks. A DHCP server enables computers to request IP addresses and networking parameters automatically from the Internet service provider (ISP), reducing the need for a network administrator or a user to manually assign IP addresses to all network devices. In the absence of a DHCP server, a computer or other device on the network needs to be manually assigned an IP address, or to assign itself an APIPA address, the latter of which will not enable it to communicate outside its local subnet.

Operation

The DHCP employs a connectionless service model, using the User Datagram Protocol (UDP). It is implemented with two UDP port numbers for its operations which are the same as for the bootstrap protocol (BOOTP). UDP port number 67 is the destination port of a server, and UDP port number 68 is used by the client.

DHCP operations fall into four phases: server discovery, IP lease offer, IP lease request, and IP lease acknowledgement. These stages are often abbreviated as DORA for discovery, offer, request, and acknowledgement.

The DHCP operation begins with clients broadcasting a request. If the client and server are on different subnets, a DHCP Helper or DHCP Relay Agent may be used. Clients requesting renewal of an existing lease may communicate directly via UDP unicast, since the client already has an established IP address at that point.





Configuration

Simple DHCP configuration on Cisco Route,


Here we us cisco 1841 router as DHCP Server, fast ethernet 0/0(f0/0) is connected with switch. 3 host are connected with switch as configured as DHCP mode.

Synatax:

#ip dhcp pool <name pool>

#network<A.B.C.D-network address> <Subnetmask>

#default-router <A.B.C.D-Ip address of the gateway Ip>

#dns-server <A.B.C.D-dns server Ip address>

 

Start the configuration

Router>enable

#enter to privilege mode

Router#configure terminal 

#global configuration mode

Router(config)#hostname Gateway

#assign hostname as Gateway for router

Gateway(config)#interface fastethernet 0/0

#select the interface

Gateway(config-if)#ip address 192.168.0.1 255.255.255.0

#assign IP Address for selected interface as 192.168.0.1

Gateway(config-if)#no shutdown

#turn on the interface

Gateway(config-if)#exit

Gateway(config)#ip dhcp pool A

#create DHCP pool named as “A”

Gateway(dhcp-config)#network 192.168.0.0 255.255.255.0

#assign network details for DHCP

Gateway(dhcp-config)#default-router 192.168.0.1

#assign default-router

Gateway(dhcp-config)#dns-server 192.168.0.1

Gateway(dhcp-config)#dns-server 8.8.8.8

Gateway(dhcp-config)#end

Gateway#

Gateway#show ip dhcp binding

IP address       Client-ID/              Lease expiration        Type

                 Hardware address

192.168.0.2      00D0.FFC8.5E8E           --                     Automatic

192.168.0.3      0004.9A39.0151           --                     Automatic

192.168.0.4      0001.431B.0551           --                     Automatic

Gateway#show ip dhcp pool

 

Pool A :

 Utilization mark (high/low)    : 100 / 0

 Subnet size (first/next)       : 0 / 0

 Total addresses                : 254

 Leased addresses               : 3

 Excluded addresses             : 0

 Pending event                  : none

 

 1 subnet is currently in the pool

 Current index        IP address range                    Leased/Excluded/Total

 192.168.0.1          192.168.0.1      - 192.168.0.254     3    / 0     / 254

Gateway#

If we want to exclude Ip address from DHCP pool, then

Syntax: # ip dhcp excluded-address <A.B.C.D>

Eg:# ip dhcp excluded-address 192.168.0.2

If we want to exclude range of IP address from DHCP Pool, than

Syntax: #ip dhcp excluded-address <start IP> <End IP>

Eg:# ip dhcp excluded-address 192.168.0.2 192.168.0.10

Configuration:

Gateway(config)#ip dhcp excluded-address 192.168.0.2

#here we excluded one IP (192.168.0.2)

Gateway(config)#exit

Gateway#

Gateway#show ip dhcp binding

IP address       Client-ID/              Lease expiration        Type

                 Hardware address

192.168.0.3      0004.9A39.0151           --                     Automatic

192.168.0.4      0001.431B.0551           --                     Automatic

192.168.0.5      00D0.FFC8.5E8E           --                     Automatic

Gateway#

Same way, we can exclude range of IP

Gateway(config)#ip dhcp excluded-address 192.168.0.2 192.168.0.10

#here we excluded IP range from  (192.168.0.2- 192.168.0.10), s

Gateway(config)#exit

Gateway#show ip dhcp binding

IP address       Client-ID/              Lease expiration        Type

                 Hardware address

192.168.0.11     00D0.FFC8.5E8E           --                     Automatic

192.168.0.12     0004.9A39.0151           --                     Automatic

192.168.0.13     0001.431B.0551           --                     Automatic

Gateway#

DHCP Relay Agent

DHCP relay agent is any TCP/IP host which is used to forward request and replies between DHCP server and client when the server is present on the different network. Relay agents receive DHCP messages and then generate a new DHCP message to send out on another INTERFACE. Also, DHCP relay agent adds a giaddr (gateway address of packet) field and also the Relay agent information option 82 if enabled. The option field is removed when the server reply is forwarded to the host.

Note – The discover and request messages are unicast by the DHCP relay agent.

 

Configuration:

Here we connected another router on f0/1 in Gateway router and f0/0 in Router 4. Assign the IP address 172.16.10.1 on f0/1 in Gateway Router and 172.16.10.2 on f0/0 in Router 4. In router 4, f0/1 is assigned as 172.16.11.1

In Gateway router,

#configuring f0/1 interface

Gateway>enable

Gateway#configure terminal

Gateway(config)#interface fastEthernet 0/1

Gateway(config-if)#ip address 172.16.10.1 255.255.255.0

Gateway(config-if)#no shutdown

Gateway(config-if)#exit

In Router 4,

Router>enable

Router#configure terminal

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip address 172.16.10.2 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

 

#here f0/1, we connected our host.

Router(config)#interface fastEthernet 0/1

Router(config-if)#ip address 172.16.11.1 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#ip helper-address 192.168.0.1

#assign the DHCP server details

Router(config-if)#exit

Router(config)#ip route 192.168.0.0 255.255.255.0 f0/0

#create a static route for communicating between these network

Router(config)#exit

Router#

In Gateway router,

#creating DHCP pool for second router host

Gateway(config)#ip dhcp pool B

Gateway(dhcp-config)#network 172.16.11.0 255.255.255.0

Gateway(dhcp-config)#default-router 172.16.11.1

Gateway(dhcp-config)#exit

#create a static route for communicating between these network

Gateway(config)#ip route 172.16.11.0 255.255.255.0 f0/1

Gateway(config)#exit

Gateway#show ip dhcp pool

Pool A :

 Utilization mark (high/low)    : 100 / 0

 Subnet size (first/next)       : 0 / 0

 Total addresses                : 254

 Leased addresses               : 3

 Excluded addresses             : 2

 Pending event                  : none

 

 1 subnet is currently in the pool

 Current index        IP address range                    Leased/Excluded/Total

 192.168.0.1          192.168.0.1      - 192.168.0.254     3    / 2     / 254

 

Pool B :

 Utilization mark (high/low)    : 100 / 0

 Subnet size (first/next)       : 0 / 0

 Total addresses                : 254

 Leased addresses               : 3

 Excluded addresses             : 2

 Pending event                  : none

 

 1 subnet is currently in the pool

 Current index        IP address range                    Leased/Excluded/Total

 172.16.11.1          172.16.11.1      - 172.16.11.254     3    / 2     / 254

Gateway#`

 

Gateway#show ip dhcp binding

IP address Client-ID/ Lease expiration Type

Hardware address

192.168.0.11 00D0.FFC8.5E8E -- Automatic

192.168.0.12 0004.9A39.0151 -- Automatic

192.168.0.13 0001.431B.0551 -- Automatic

172.16.11.29 000A.41A3.A29C -- Automatic

172.16.11.31 0002.177E.1169 -- Automatic

172.16.11.32 00E0.8F82.4D73 -- Automatic

Gateway#


Special Thanks to  Corona institute.......✋

Comments

Popular posts from this blog

SharePoint 2019 installation on premises(Manually)

Hardware and software requirements for SharePoint Server 2019   Hardware requirements   A Standard or Enterprise Edition of SQL Server for Windows that supports database compatibility level 130. This includes SQL Server 2016, SQL Server 2017, SQL Server 2019, and any future version of SQL Server for Windows that supports database compatibility level 130. For more information about database compatibility levels, see Compatibility Certification and ALTER DATABASE (Transact-SQL) Compatibility Level. Installation scenario Deployment type and scale RAM Processor Hard disk space Single server role that uses SQL Server Development or evaluation installation of SharePoint Server 2019 with the minimum recommended services for development environments. Use the Single-Server farm role that will let you choose which service applications to provision 16 GB 64-bit, ...

Form a Catalyst 3850 Data-Stack and Power-Stack

  1          Scope To form a Catalyst 3850 Data-stack and Power -stack 2          Pre-requisite Catalyst 3850 switches can share bandwidth by using data stacking. §   To be able to form a switch stack more than 2 switches must be used. §   The IOS version used must be the same for all switches. (Software auto upgrade can be configuring on an existing stack to automatically upgrade newly added switches). §   The same mode must be used on all the switches INSTALL or BUNDLE mode §   The right type of cables must be used to achieve stack completion. Be aware that cables for the 3750 platform do not work on the 3850 platform.   The following switch models do not support StackWise-480: ü   WS-C3850-48XS-S ü   WS-C3850-48XS-E ü   WS-C3850-48XS-F-S ü   WS-C3850-48XS-F-E 2.1       Components Used §   Cisco Ca...

Quest- Binary Directory Sync Pro-Installation Guide

  Directory Sync Pro Prerequisites   Supported Environments   The following is a list of supported and unsupported environments. If implementing directory synchronization between two Active Directory environments, you will need a Binary Tree Windows Server and an SQL Server database server.   Supported Not Supported Binary Tree Windows Server Windows Server 2012 R2, Windows Server 2016, or Windows Server 2019; US English Operating System All other versions of Windows Server SQL Server Database SQL Server can be a new or existing database server in the customer’s environment. The following SQL Server versions (English versions) are supported: • SQL Server 2008 R2 • SQL Server 2008 R2 Express with Advanced Services • SQL Server 2012 SP2 • SQL Server 2012 SP2 Express with Advanced Services • SQL Server 2014 • SQL Server 2014 Express with Advanced Services • SQL S...