DHCP (Dynamic Host Configuration Protocol)
Hc/Ro. Tapan Kumar Khilar
DHCP - Introduction
 DHCP was created by the Dynamic Host Configuration
Working Group of the Internet Engineering Task Force(IETF)
 Runs over UDP
 Utilizing ports:
 67 – connections to server
 68 – connections to client
 Extension of BOOTP (protocol used for simple interaction)-
DHCP enhances the capabilities of BOOTP
 DHCP is basically used for dynamic configuration
 Uses client–server model
Objective of DHCP
 DHCP temporarily binds IP address & other configuration
parameters to DHCP client & provides framework for passing
configuration information to hosts
 DHCP was designed to provide computers with temporary
address
 DHCP is well adapted to situation where hosts move from one
location to another or are routinely connected and
disconnected
 Thus DHCP is mainly used to simplify the installation &
maintenance of networked computers.
Characteristics
 Centralized IP address administration
 Backward compatible with BOOTP – therefore a host running
the BOOTP client software can request a static configuration
from a DHCP server
 Supports multiple servers
 Provides dynamic assignment
 Allows static assignment
 DoesŶ’t iŶteract ǁith doŵaiŶ Ŷaŵe serǀice (DNS)
 Clients should require no manual configuration by
the user to connect to the network.
◦ Each client should be able to discover appropriate
configuration information dynamically.
RD-CSY2001-2008/09
 IP address, DNS servers, WINS servers, etc.
 This is normally accomplished through the use of a
Dynamic Host Configuration Protocol
◦ Uses UDP
◦ Ports 67 and 68
 DHCP
◦ Requires little or no administrative overhead,
after initial configurations of the DHCP
server.
◦ Dynamically maps IP addresses to MAC
addresses.
◦ Addresses can be leased for a predefined
amount of time before the lease expires and
must be renewed by the client.
◦ Allows 30 configuration parameters.
RD-CSY2001-2008/09
Client IP: ??
Gateway: ??
DNS: ??
Client IP: 192.168.1.10/24
Gateway: 192.168.1.1
DNS: 192.168.1.6
DHCPDISCOVER
Broadcast for a DHCP Server
Pool: 192.168.1.0/24
Gateway: 192.168.1.1
DNS Server: 192.168.1.6
DHCPOFFER
MAC unicast with configuration
information
DHCPREQUEST
Broadcast requesting
configuration information sent
in DHCPOFFER
DHCPACK
Acknowledge configuration
information and begins lease
RD-CSY2001-2008/09
 DHCP operates in a Client/Server environment and uses
the following messages


RD-CSY2001-2008/09
DHCPDISCOVER : Client request for server
DHCPOFFER: DHCP server replies to client with
configuration information
DHCPREQUEST: Client requests the use of configuration
information from one of the DHCP servers that sent an
offer

 DHCPNAK
◦ DHCP server declines Client request to use
configuration information
◦ DHCPACK:
◦ from DHCP server acknowledges that Client can now
begin to use configuration information
DHCPRELEASE
◦ Client requests a release of its DHCP configuration

 A Cisco router can be
configured as a DHCP
server.
◦ Cisco calls this IOS
feature “Easy IP”
◦ This feature is helpful
for small, remote LANs
such as home offices
with only one router
and a few clients.
◦ In a large, campus
network, you would not
want to use a router as a
DHCP server.
RD-CSY2001-2008/09
1. Configure a named DHCP pool
2. Configure network/subnet mask pool
RD-CSY2001-2008/09
3. Configure the default gateway
4. Configure addresses to exclude from the DHCP
address pool
5. Configure other needed information
◦ Such as DNS server, Domain Name, NetBIOS Server
 Like NAT, a DHCP pool must be named before you
can enter DHCP configuration mode.
◦ The argument name identifies the DHCP pool in the running
configuration and distinguishes this pool from other pools.
 More than one DHCP pool can be defined on a router.
RD-CSY2001-2008/09
Router(config)#ip dhcp pool name
 The net_address defines a network or subnet that
will be used as a pool of addresses to assign IP address
to clients.
◦ You must also define the subnet mask.
RD-CSY2001-2008/09
Router(dhcp-config)#network net_address
subnet_mask
 The ip_address is the address of the default
gateway clients will use to send packets destined for
remote networks.
◦ In a simple Easy IP configuration, this is the IP address of the
interface that is directly connected to the LAN with clients
needing DHCP service.
RD-CSY2001-2008/09
 You also need to exclude this IP address in the ip
excluded-address command.
dhcp
Router(dhcp-config)#default-router
ip_address
 The address(es) configured with this command will not
be assigned by Easy IP to clients.
◦ The argument address_1 is a single IP address that will be
excluded.
◦ If configured, the address_n optional argument defines a
range of excluded IP addresses between and including
argument_1 to argument_n.
RD-CSY2001-2008/09
Router(config)#ip dhcp excluded-address
address_1 [address_n]
Router(dhcp-config)#dns-server
ip_address
Router(dhcp-config)#netbios-name-server
ip_address
Router(dhcp-config)#domain-name name
RD-CSY2001-2008/09
RTA(config)#ip dhcp excluded-address 10.1.1.1
RTA(config)#ip dhcp pool RTA_LAN
10.1.1.0 255.255.255.0RTA(dhcp-
config)#networkRTA(dhcp-config)#default-router 10.1.1.1
RD-CSY2001-2008/09
 Routers normally block all broadcasts,
including a broadcasted DHCP message.
◦ If the router is not the DHCP server, you
must configure the router to forward the
DHCP messages to a dhcp_server_ip.
RD-CSY2001-2008/09
Router(config)#ip helper-address
dhcp_server_ip
 The ip helper-
address command
configures the router to
forward eight UDP services:
◦ Time
◦ TACACS
◦ DNS
◦ BOOTP/DHCP Server
◦ BOOTP/DHCP Client
◦ TFTP
◦ NetBIOS Name Service
◦ NetBIOS datagram
Service
RTA(config)#ip helper-address 10.2.2.5
RD-CSY2001-2008/09

RD-CSY2001-2008/09
Use the following commands to verify and troubleshoot
your DHCP configuration:
◦ show running-config
 view the DHCP configuration
◦ show ip dhcp binding
 displays IP to MAC address bindings and lease expiration date and
time
◦ show ip dhcp server statistics
 displays a count of the number and type of DHCP messages sent and
received
◦ debug ip dhcp server events
 watch interactions between the DHCP server and clients

Dhcp

  • 1.
    DHCP (Dynamic HostConfiguration Protocol) Hc/Ro. Tapan Kumar Khilar
  • 2.
    DHCP - Introduction DHCP was created by the Dynamic Host Configuration Working Group of the Internet Engineering Task Force(IETF)  Runs over UDP  Utilizing ports:  67 – connections to server  68 – connections to client  Extension of BOOTP (protocol used for simple interaction)- DHCP enhances the capabilities of BOOTP  DHCP is basically used for dynamic configuration  Uses client–server model
  • 3.
    Objective of DHCP DHCP temporarily binds IP address & other configuration parameters to DHCP client & provides framework for passing configuration information to hosts  DHCP was designed to provide computers with temporary address  DHCP is well adapted to situation where hosts move from one location to another or are routinely connected and disconnected  Thus DHCP is mainly used to simplify the installation & maintenance of networked computers.
  • 4.
    Characteristics  Centralized IPaddress administration  Backward compatible with BOOTP – therefore a host running the BOOTP client software can request a static configuration from a DHCP server  Supports multiple servers  Provides dynamic assignment  Allows static assignment  DoesŶ’t iŶteract ǁith doŵaiŶ Ŷaŵe serǀice (DNS)
  • 5.
     Clients shouldrequire no manual configuration by the user to connect to the network. ◦ Each client should be able to discover appropriate configuration information dynamically. RD-CSY2001-2008/09  IP address, DNS servers, WINS servers, etc.  This is normally accomplished through the use of a Dynamic Host Configuration Protocol ◦ Uses UDP ◦ Ports 67 and 68
  • 6.
     DHCP ◦ Requireslittle or no administrative overhead, after initial configurations of the DHCP server. ◦ Dynamically maps IP addresses to MAC addresses. ◦ Addresses can be leased for a predefined amount of time before the lease expires and must be renewed by the client. ◦ Allows 30 configuration parameters. RD-CSY2001-2008/09
  • 7.
    Client IP: ?? Gateway:?? DNS: ?? Client IP: 192.168.1.10/24 Gateway: 192.168.1.1 DNS: 192.168.1.6 DHCPDISCOVER Broadcast for a DHCP Server Pool: 192.168.1.0/24 Gateway: 192.168.1.1 DNS Server: 192.168.1.6 DHCPOFFER MAC unicast with configuration information DHCPREQUEST Broadcast requesting configuration information sent in DHCPOFFER DHCPACK Acknowledge configuration information and begins lease RD-CSY2001-2008/09
  • 8.
     DHCP operatesin a Client/Server environment and uses the following messages   RD-CSY2001-2008/09 DHCPDISCOVER : Client request for server DHCPOFFER: DHCP server replies to client with configuration information DHCPREQUEST: Client requests the use of configuration information from one of the DHCP servers that sent an offer   DHCPNAK ◦ DHCP server declines Client request to use configuration information ◦ DHCPACK: ◦ from DHCP server acknowledges that Client can now begin to use configuration information DHCPRELEASE ◦ Client requests a release of its DHCP configuration 
  • 9.
     A Ciscorouter can be configured as a DHCP server. ◦ Cisco calls this IOS feature “Easy IP” ◦ This feature is helpful for small, remote LANs such as home offices with only one router and a few clients. ◦ In a large, campus network, you would not want to use a router as a DHCP server. RD-CSY2001-2008/09
  • 10.
    1. Configure anamed DHCP pool 2. Configure network/subnet mask pool RD-CSY2001-2008/09 3. Configure the default gateway 4. Configure addresses to exclude from the DHCP address pool 5. Configure other needed information ◦ Such as DNS server, Domain Name, NetBIOS Server
  • 11.
     Like NAT,a DHCP pool must be named before you can enter DHCP configuration mode. ◦ The argument name identifies the DHCP pool in the running configuration and distinguishes this pool from other pools.  More than one DHCP pool can be defined on a router. RD-CSY2001-2008/09 Router(config)#ip dhcp pool name
  • 12.
     The net_addressdefines a network or subnet that will be used as a pool of addresses to assign IP address to clients. ◦ You must also define the subnet mask. RD-CSY2001-2008/09 Router(dhcp-config)#network net_address subnet_mask
  • 13.
     The ip_addressis the address of the default gateway clients will use to send packets destined for remote networks. ◦ In a simple Easy IP configuration, this is the IP address of the interface that is directly connected to the LAN with clients needing DHCP service. RD-CSY2001-2008/09  You also need to exclude this IP address in the ip excluded-address command. dhcp Router(dhcp-config)#default-router ip_address
  • 14.
     The address(es)configured with this command will not be assigned by Easy IP to clients. ◦ The argument address_1 is a single IP address that will be excluded. ◦ If configured, the address_n optional argument defines a range of excluded IP addresses between and including argument_1 to argument_n. RD-CSY2001-2008/09 Router(config)#ip dhcp excluded-address address_1 [address_n]
  • 15.
  • 16.
    RTA(config)#ip dhcp excluded-address10.1.1.1 RTA(config)#ip dhcp pool RTA_LAN 10.1.1.0 255.255.255.0RTA(dhcp- config)#networkRTA(dhcp-config)#default-router 10.1.1.1 RD-CSY2001-2008/09
  • 17.
     Routers normallyblock all broadcasts, including a broadcasted DHCP message. ◦ If the router is not the DHCP server, you must configure the router to forward the DHCP messages to a dhcp_server_ip. RD-CSY2001-2008/09 Router(config)#ip helper-address dhcp_server_ip
  • 18.
     The iphelper- address command configures the router to forward eight UDP services: ◦ Time ◦ TACACS ◦ DNS ◦ BOOTP/DHCP Server ◦ BOOTP/DHCP Client ◦ TFTP ◦ NetBIOS Name Service ◦ NetBIOS datagram Service RTA(config)#ip helper-address 10.2.2.5 RD-CSY2001-2008/09
  • 19.
     RD-CSY2001-2008/09 Use the followingcommands to verify and troubleshoot your DHCP configuration: ◦ show running-config  view the DHCP configuration ◦ show ip dhcp binding  displays IP to MAC address bindings and lease expiration date and time ◦ show ip dhcp server statistics  displays a count of the number and type of DHCP messages sent and received ◦ debug ip dhcp server events  watch interactions between the DHCP server and clients