Sunday, 1 July 2012

How to configure dhcp server in router (packet tracer)

.                                          For studing purpose only not for commercial use                
                                                   


  DHCP stands for Dynamic Host Configuration Protocol .it's an client/server protocol .which is used to a automatically assign ip addresses to the host and other useful informaion like subnet mask,default- gateway etc.
  Dhcp can be configured in Windows,Linux as well as Cico router.but here we will learn how to configure Dhcp server in cisco routers in packet tracer.

Dhcp works by configuring server to give out IP configuration information to clients and the clients lease the information from dhcp server for an
defined period. when the lease is up,the host must ask for another address and sever will reassign the ip configuraion .
Dhcp server also provide information like defaut-gateway address,dns server address,win server address and domain name etc.

Dhcp working process: dhcp works on DORA process.

D = dicover.

O = offer

R = request.

A = acknowledgement.


Discover: the device send a dicover requet asking for it's IP information from any listening dhcp sever.

Offer: Any listening dhcp server on the network offer the IP configuration information to clients .

Request: In  response to the offer .client send broadcast request to the server about it's IP information .

Ankowledgement: The dhcp server send ip information to the clients with ackowledgemen.

                                                How to configure dhcp server in Cisco routers in packet tracer.


* Step by step configuration.
    
Router>enable
Router#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0     ( Lan interface)
Router(config-if)#ip ad
Router(config-if)#ip address 192.168.20.1 255.255.255.0 ( we will use 192.168.20.1 address for defaualt- router through which our packet(data) goes out from our local network to internet or other network .)
Router(config-if)#no sh
Router(config-if)#no shutdown


%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Router(config-if)#
Router(config-if)#

Router(config-if)#
Router(config-if)#
Router(config-if)#do cop
Router(config-if)#do cop ru    ( we can also use control + z to save our configuration)
Router(config-if)#do cop ru st
Destination filename [startup-config]?
Building configuration...
[OK]
Router(config-if)#

Router(config)#ip dhcp excluded-address 192.168.20.10 192.168.20.40   ( The range of address saved for special purpose by admin like to asign tftp server or maybe dns server.)
Router(config)#


Router(config)#ip dhcp pool abc  ( name of the dhcp pool)

Router(dhcp-config)#network 192.168.20.0 255.255.255.0

Router(dhcp-config)#default-router 192.168.20.1

Router(dhcp-config)#dns-server 192.168.20.10 (dns ip address is  taken from excluded range.)

Router(dhcp-config)#lease 5  (ip assigned for the clients for 5 days .after that the lease will be expired and the clients has to request again to the dhcp server for ip addresses.

Router(dhcp-config)#^Z
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#

Router#cop running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Router#

Router#sh ip dhcp binding ( command use to see the assigh ip address)
        

No comments:

Post a Comment