SlideShare a Scribd company logo
Switching, Routing and Wireless
Essentials v7.0 (SRWE)
Module 7: DHCPv4
2
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module Objectives
Module Title: DHCPv4
Module Objective: Implement DHCPv4 to operate across multiple LANs
Topic Title Topic Objective
DHCP4 Concepts
Explain how DHCPv4 operates in a small- to medium-
sized business network.
Configure a Cisco IOS DHCP4 Server Configure a router as a DHCPv4 server.
Configure a DHCP4 Client Configure a router as a DHCPv4 client.
3
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
7.1 DHCPv4 Concepts
4
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
DHCPv4 Concepts
DHCPv4 Server and Client
• Dynamic Host Configuration Protocol v4 (DHCPv4) assigns IPv4 addresses and other
network configuration information dynamically. Because desktop clients typically make up the
bulk of network nodes, DHCPv4 is an extremely useful and timesaving tool for network
administrators.
• A dedicated DHCPv4 server is scalable and relatively easy to manage. However, in a small
branch or SOHO location, a Cisco router can be configured to provide DHCPv4 services
without the need for a dedicated server. Cisco IOS software supports an optional, full-
featured DHCPv4 server.
• The DHCPv4 server dynamically assigns, or leases, an IPv4 address from a pool of
addresses for a limited period of time chosen by the server, or until the client no longer
needs the address.
• Clients lease the information from the server for an administratively defined period.
Administrators configure DHCPv4 servers to set the leases to time out at different intervals.
The lease is typically anywhere from 24 hours to a week or more. When the lease expires,
the client must ask for another address, although the client is typically reassigned the same
address.
5
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
DHCPv4 Concepts
DHCPv4 Operation
DHCPv4 works in a client/server mode. When a client communicates with a DHCPv4
server, the server assigns or leases an IPv4 address to that client.
• The client connects to the network with that leased IPv4 address until the lease
expires. The client must contact the DHCP server periodically to extend the lease.
• This lease mechanism ensures that clients that move or power off do not keep
addresses that they no longer need.
• When a lease expires, the DHCP server returns the address to the pool where it can
be reallocated as necessary.
6
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
DHCPv4 Concepts
Steps to Obtain a Lease
When the client boots (or
otherwise wants to join a
network), it begins a four-step
process to obtain a lease:
1. DHCP Discover
(DHCPDISCOVER)
2. DHCP Offer (DHCPOFFER)
3. DHCP Request
(DHCPREQUEST)
4. DHCP Acknowledgment
(DHCPACK)
7
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
DHCPv4 Concepts
Steps to Renew a Lease
Prior to lease expiration, the client begins a two-
step process to renew the lease with the DHCPv4
server, as shown in the figure:
1. DHCP Request (DHCPREQUEST)
Before the lease expires, the client sends a
DHCPREQUEST message directly to the
DHCPv4 server that originally offered the IPv4
address. If a DHCPACK is not received within a
specified amount of time, the client broadcasts
another DHCPREQUEST so that one of the other
DHCPv4 servers can extend the lease.
2. DHCP Acknowledgment (DHCPACK)
On receiving the DHCPREQUEST message, the
server verifies the lease information by returning a
DHCPACK.
Note: These messages (primarily the DHCPOFFER and
DHCPACK) can be sent as unicast or broadcast according
to IETF RFC 2131.
8
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
7.2 Configure a Cisco IOS
DHCPv4 Server
9
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Cisco IOS DHCPv4 Server
Now you have a basic understanding of how DHCPv4 works and how it can make your
job a bit easier. A Cisco router running Cisco IOS software can be configured to act as a
DHCPv4 server. The Cisco IOS DHCPv4 server assigns and manages IPv4 addresses
from specified address pools within the router to DHCPv4 clients.
10
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Steps to Configure a Cisco IOS DHCPv4 Server
Use the following steps to configure a Cisco IOS DHCPv4 server:
• Step 1. Exclude IPv4 addresses. A single address or a range of addresses can be
excluded by specifying the low-address and high-address of the range. Excluded
addresses should be those addresses that are assigned to routers, servers, printers,
and other devices that have been, or will be, manually configured. You can also enter
the command multiple times. The command is ip dhcp excluded-address low-
address [high-address]
• Step 2. Define a DHCPv4 pool name. The ip dhcp pool pool-name command creates
a pool with the specified name and puts the router in DHCPv4 configuration mode,
which is identified by the prompt Router(dhcp-config)#.
11
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Steps to Configure a Cisco IOS DHCPv4 Server (Cont.)
• Step 3. Configure the DHCPv4 pool. The address pool and default gateway router must be
configured. Use the network statement to define the range of available addresses. Use
the default-router command to define the default gateway router. These commands and
other optional commands are shown in the table.
Task IOS Command
Define the address pool. network network-number [mask | / prefix-length]
Define the default router or gateway. default-router address [ address2….address8]
Define a DNS server. dns-server address [ address2…address8]
Define the domain name. domain-name domain
Define the duration of the DHCP lease. lease {days [hours [ minutes]] | infinite}
Define the NetBIOS WINS server. netbios-name-server address [ address2…address8]
12
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Configuration Example
13
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
DHCPv4 Verification
Use the commands in the table to verify that the Cisco IOS DHCPv4 server is operational.
Command Description
show running-config | section dhcp Displays the DHCPv4 commands configured on the router.
show ip dhcp binding
Displays a list of all IPv4 address to MAC address bindings provided by the
DHCPv4 service.
show ip dhcp server statistics
Displays count information regarding the number of DHCPv4 messages
that have been sent and received
14
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Verify DHCPv4 is Operational
Verify the DHCPv4 Configuration: As shown in the example, the show running-config
| section dhcp command output displays the DHCPv4 commands configured on R1.
The | section parameter displays only the commands associated with DHCPv4
configuration.
15
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Verify DHCPv4 is Operational (Cont.)
Verify DHCPv4 Bindings: As shown in the example, the operation of DHCPv4 can be
verified using the show ip dhcp binding command. This command displays a list of all
IPv4 address to MAC address bindings that have been provided by the DHCPv4 service.
16
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Verify DHCPv4 is Operational (Cont.)
Verify DHCPv4 Statistics: The output
of the show ip dhcp server
statistics is used to verify that
messages are being received or sent by
the router. This command displays count
information regarding the number of
DHCPv4 messages that have been sent
and received.
17
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Verify DHCPv4 is Operational (Cont.)
Verify DHCPv4 Client Received IPv4
Addressing: The ipconfig
/all command, when issued on PC1,
displays the TCP/IP parameters, as
shown in the example. Because PC1
was connected to the network
segment 192.168.10.0/24, it
automatically received a DNS suffix,
IPv4 address, subnet mask, default
gateway, and DNS server address
from that pool. No DHCP-specific
router interface configuration is
required. If a PC is connected to a
network segment that has a DHCPv4
pool available, the PC can obtain an
IPv4 address from the appropriate
pool automatically.
18
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Disable the Cisco IOS DHCPv4 Server
The DHCPv4 service is enabled by
default. To disable the service, use
the no service dhcp global
configuration mode command. Use
the service dhcp global
configuration mode command to re-
enable the DHCPv4 server process,
as shown in the example. Enabling
the service has no effect if the
parameters are not configured.
Note: Clearing the DHCP bindings
or stopping and restarting the DHCP
service may result in duplicate IP
addresses being temporarily
assigned on the network.
19
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
DHCPv4 Relay
• In a complex hierarchical network, enterprise servers are usually located centrally. These servers may
provide DHCP, DNS, TFTP, and FTP services for the network. Network clients are not typically on the
same subnet as those servers. In order to locate the servers and receive services, clients often use
broadcast messages.
• In the figure, PC1 is attempting to acquire an IPv4 address from a DHCPv4 server using a broadcast
message. In this scenario, R1 is not configured as a DHCPv4 server and does not forward the
broadcast. Because the DHCPv4 server is located on a different network, PC1 cannot receive an IP
address using DHCP. R1 must be configured to relay DHCPv4 messages to the DHCPv4 server.
20
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
DHCPv4 Relay (Cont.)
• Configure R1 with the ip helper-address address interface configuration command.
This will cause R1 to relay DHCPv4 broadcasts to the DHCPv4 server. As shown in
the example, the interface on R1 receiving the broadcast from PC1 is configured to
relay DHCPv4 address to the DHCPv4 server at 192.168.11.6.
• When R1 has been configured as a DHCPv4 relay agent, it accepts broadcast
requests for the DHCPv4 service and then forwards those requests as a unicast to the
IPv4 address 192.168.11.6. The network administrator can use the show ip
interface command to verify the configuration.
21
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Other Service Broadcasts Relayed
DHCPv4 is not the only service that the router can be configured to relay. By default,
the ip helper-address command forwards the following eight UDP services:
• Port 37: Time
• Port 49: TACACS
• Port 53: DNS
• Port 67: DHCP/BOOTP server
• Port 68: DHCP/BOOTP client
• Port 69: TFTP
• Port 137: NetBIOS name service
• Port 138: NetBIOS datagram service
22
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a Cisco IOS DHCPv4 Server
Packet Tracer – Configure DHCPv4
In this Packet Tracer Activity, you will complete the following objectives:
• Part 1: Configure a Router as a DHCP Server
• Part 2: Configure DHCP Relay
• Part 3: Configure a Router as a DHCP Client
• Part 4: Verify DHCP and Connectivity
23
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
7.3 Configure a DHCPv4
Client
24
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a DHCPv4 Client
Cisco Router as a DHCPv4 Client
There are scenarios where you might have access to a DHCP server through your ISP. In these
instances, you can configure a Cisco IOS router as a DHCPv4 client.
• Sometimes, Cisco routers in a small office or home office (SOHO) and branch sites have to be
configured as DHCPv4 clients in a similar manner to client computers. The method used depends
on the ISP. However, in its simplest configuration, the Ethernet interface is used to connect to a
cable or DSL modem.
• To configure an Ethernet interface as a DHCP client, use the ip address dhcp
interface configuration mode command.
• In the figure, assume that an ISP has been configured to provide select customers with IP
addresses from the 209.165.201.0/27 network range after the G0/0/1 interface is configured with
the ip address dhcp command.
25
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a DHCPv4 Client
Configuration Example
• To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration
mode command, as shown in the example. This configuration assumes that the ISP has been configured to
provide select customers with IPv4 addressing information.
• The show ip interface g0/1 command confirms that the interface is up and that the address was allocated
by a DHCPv4 server.
26
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Configure a DHCPv4 Client
Home Router as a DHCPv4 Client
Home routers are typically already set to receive IPv4 addressing information automatically from the
ISP. This is so that customers can easily set up the router and connect to the internet.
• For example, the figure shows the default WAN setup page for a Packet Tracer wireless router.
Notice that the internet connection type is set to Automatic Configuration - DHCP. This
selection is used when the router is connected to a DSL or cable modem and acts as a DHCPv4
client, requesting an IPv4 address from the ISP.
• Various manufacturers of home routers will have a similar setup.
27
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
7.4 Module Practice and Quiz
28
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module Practice and Quiz
Packet Tracer – Implement DHCPv4
In this Packet Tracer, you will complete the following objectives:
• Part 1: Configure a Router as a DCHP Server
• Part 2: Configure DCHP Relay
• Part 3: configure a Router as a DCHP Client
29
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module Practice and Quiz
Lab – Implement DHCPv4
In this lab, you will complete the following objectives:
 Part 1: Build the Network and Configure Basic Device Settings
 Part 2: Configure and Verify Two DHCPv4 Servers on R1
 Part 3: Configure and Verify a DHCP Relay on R2
30
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module Practice and Quiz
What Did I Learn In This Module?
• The DHCPv4 server dynamically assigns, or leases, an IPv4 address to a client from a pool of addresses
for a limited period of time chosen by the server, or until the client no longer needs the address.
• The DHCPv4 lease process begins with the client sending message requesting the services of a DHCP
server. If there is a DHCPv4 server that receives the message it will respond with an IPv4 address and
possible other network configuration information.
• The client must contact the DHCP server periodically to extend the lease. This lease mechanism ensures
that clients that move or power off do not keep addresses that they no longer need.
• When the client boots (or otherwise wants to join a network), it begins a four-step process to obtain a
lease: DHCPDISCOVER, then DHCPOFFER, then DHCPREQUEST, and finally DHCPACK. Prior to lease
expiration, the client begins a two-step process to renew the lease with the DHCPv4 server:
DHCPREQUEST then DHCPACK.
• A Cisco router running Cisco IOS software can be configured to act as a DHCPv4 server.
• Use the following steps to configure a Cisco IOS DHCPv4 server: exclude IPv4 addresses, define a
DHCPv4 pool name, and configure the DHCPv4 pool.
• Verify your configuration using the show running-config | section dhcp, show ip dhcp binding, and
show ip dhcp server statistics commands.
• The DHCPv4 service is enabled, by default. To disable the service, use the no service dhcp global
configuration mode command.
31
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module Practice and Quiz
What Did I Learn In This Module? (Cont.)
• Network clients are not typically on the same subnet as enterprise servers providing DHCP, DNS, TFTP, and
FTP services for the network. In order to locate the servers and receive services, clients often use broadcast
messages. The router must be configured to relay DHCPv4 messages to the DHCPv4 server.
• The network administrator can configure the router with the ip helper-address address interface configuration
command and use the show ip interface command to verify the configuration.
• By default, the ip helper-address command forwards the following eight UDP services:
• Port 37: Time
• Port 49: TACACS
• Port 53: DNS
• Port 67: DHCP/BOOTP server
• Port 68: DHCP/BOOTP client
• Port 69: TFTP
• Port 137: NetBIOS name service
• Port 138: NetBIOS datagram service
• To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode
command.
• Home routers are typically already set to receive IPv4 addressing information automatically from the ISP. The
internet connection type is set to Automatic Configuration - DHCP. This selection is used when the router is
connected to a DSL or cable modem and acts as a DHCPv4 client, requesting an IPv4 address from the ISP.
Group-7-DHCPv4.pptx

More Related Content

PDF
Difference b/w STP RSTP PVST & MSTP
PPTX
Network Forensics Intro
PPTX
CCNA 2 Routing and Switching v5.0 Chapter 11
PPTX
CCNA 2 Routing and Switching v5.0 Chapter 10
PPTX
802.1x
PDF
Overview of Spanning Tree Protocol
PDF
1000 Ccna Questions And Answers
Difference b/w STP RSTP PVST & MSTP
Network Forensics Intro
CCNA 2 Routing and Switching v5.0 Chapter 11
CCNA 2 Routing and Switching v5.0 Chapter 10
802.1x
Overview of Spanning Tree Protocol
1000 Ccna Questions And Answers

What's hot (20)

PPT
Windows forensic artifacts
PPTX
Network Protocols KS4
PPTX
Spanning tree protocol
PDF
Introduction to networks CCNAv7 Module-1
PPTX
CCNA 2 Routing and Switching v5.0 Chapter 6
PDF
PPTX
Advanced Aruba ClearPass Workshop
PPTX
NAT64 and DNS64 in 30 minutes
PPT
Spanning tree protocol
PDF
TechWiseTV Workshop: Cisco DNA Center Assurance
PDF
3 cucm database
PPTX
Packet sniffing
PPTX
Ssl and tls
PPTX
EtherChannel Configuration
PPTX
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
PDF
Optimizing Aruba WLANs for Roaming Devices
DOCX
Certified Ethical Hacker quick test prep cheat sheet
PPT
Layer 2 switching fundamentals(networking)
PDF
Cisco asa firewall command line technical guide
Windows forensic artifacts
Network Protocols KS4
Spanning tree protocol
Introduction to networks CCNAv7 Module-1
CCNA 2 Routing and Switching v5.0 Chapter 6
Advanced Aruba ClearPass Workshop
NAT64 and DNS64 in 30 minutes
Spanning tree protocol
TechWiseTV Workshop: Cisco DNA Center Assurance
3 cucm database
Packet sniffing
Ssl and tls
EtherChannel Configuration
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
Optimizing Aruba WLANs for Roaming Devices
Certified Ethical Hacker quick test prep cheat sheet
Layer 2 switching fundamentals(networking)
Cisco asa firewall command line technical guide
Ad

Similar to Group-7-DHCPv4.pptx (20)

PPTX
Module (8) DHCP Server.pptx
PPTX
Dynamic Host Configuration Protocol
PPTX
Chapter 21 : DHCP
PDF
CCNAv5 - S2: Chapter10 DHCP
PPTX
Dhc pv4
PPTX
CCNA2 Verson6 Chapter8
PPTX
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 8
PPTX
DHCP Services (Ipv4 & 6).pptx
PDF
07_IP_Addressing ayudaok.pdf
PDF
07_IP_Addressing.pdf
DOCX
Networking DHCP server Setup Reports
PDF
Configurar dhcp en router cisco
PPT
CCNA Icnd110 s04l09
PPS
Linux05 DHCP Server
PPTX
Cisco CCNA- DHCP Server
PPTX
DOCX
DHCP server on a cisco router explaining its uses its how to and benefits alo...
PDF
Dhcp commandas
PPTX
CCNA v6.0 ITN - Chapter 07
PDF
Guide to TCP IP 4th Edition Carrell Solutions Manual
Module (8) DHCP Server.pptx
Dynamic Host Configuration Protocol
Chapter 21 : DHCP
CCNAv5 - S2: Chapter10 DHCP
Dhc pv4
CCNA2 Verson6 Chapter8
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 8
DHCP Services (Ipv4 & 6).pptx
07_IP_Addressing ayudaok.pdf
07_IP_Addressing.pdf
Networking DHCP server Setup Reports
Configurar dhcp en router cisco
CCNA Icnd110 s04l09
Linux05 DHCP Server
Cisco CCNA- DHCP Server
DHCP server on a cisco router explaining its uses its how to and benefits alo...
Dhcp commandas
CCNA v6.0 ITN - Chapter 07
Guide to TCP IP 4th Edition Carrell Solutions Manual
Ad

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPT
Ppt for engineering students application on field effect
PDF
6th International Conference on Artificial Intelligence and Machine Learning ...
PPTX
Ship’s Structural Components.pptx 7.7 Mb
PPTX
Security-Responsibilities-in-the-Cloud-Azure-Shared-Responsibility-Model.pptx
PPTX
Internship_Presentation_Final engineering.pptx
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PDF
Introduction to Data Science: data science process
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPTX
Glazing at Facade, functions, types of glazing
PPTX
Chapter----five---Resource Recovery.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PDF
flutter Launcher Icons, Splash Screens & Fonts
PPTX
TE-AI-Unit VI notes using planning model
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Ppt for engineering students application on field effect
6th International Conference on Artificial Intelligence and Machine Learning ...
Ship’s Structural Components.pptx 7.7 Mb
Security-Responsibilities-in-the-Cloud-Azure-Shared-Responsibility-Model.pptx
Internship_Presentation_Final engineering.pptx
Simulation of electric circuit laws using tinkercad.pptx
Introduction to Data Science: data science process
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Glazing at Facade, functions, types of glazing
Chapter----five---Resource Recovery.pptx
Structs to JSON How Go Powers REST APIs.pdf
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
flutter Launcher Icons, Splash Screens & Fonts
TE-AI-Unit VI notes using planning model

Group-7-DHCPv4.pptx

  • 1. Switching, Routing and Wireless Essentials v7.0 (SRWE) Module 7: DHCPv4
  • 2. 2 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Module Objectives Module Title: DHCPv4 Module Objective: Implement DHCPv4 to operate across multiple LANs Topic Title Topic Objective DHCP4 Concepts Explain how DHCPv4 operates in a small- to medium- sized business network. Configure a Cisco IOS DHCP4 Server Configure a router as a DHCPv4 server. Configure a DHCP4 Client Configure a router as a DHCPv4 client.
  • 3. 3 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7.1 DHCPv4 Concepts
  • 4. 4 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential DHCPv4 Concepts DHCPv4 Server and Client • Dynamic Host Configuration Protocol v4 (DHCPv4) assigns IPv4 addresses and other network configuration information dynamically. Because desktop clients typically make up the bulk of network nodes, DHCPv4 is an extremely useful and timesaving tool for network administrators. • A dedicated DHCPv4 server is scalable and relatively easy to manage. However, in a small branch or SOHO location, a Cisco router can be configured to provide DHCPv4 services without the need for a dedicated server. Cisco IOS software supports an optional, full- featured DHCPv4 server. • The DHCPv4 server dynamically assigns, or leases, an IPv4 address from a pool of addresses for a limited period of time chosen by the server, or until the client no longer needs the address. • Clients lease the information from the server for an administratively defined period. Administrators configure DHCPv4 servers to set the leases to time out at different intervals. The lease is typically anywhere from 24 hours to a week or more. When the lease expires, the client must ask for another address, although the client is typically reassigned the same address.
  • 5. 5 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential DHCPv4 Concepts DHCPv4 Operation DHCPv4 works in a client/server mode. When a client communicates with a DHCPv4 server, the server assigns or leases an IPv4 address to that client. • The client connects to the network with that leased IPv4 address until the lease expires. The client must contact the DHCP server periodically to extend the lease. • This lease mechanism ensures that clients that move or power off do not keep addresses that they no longer need. • When a lease expires, the DHCP server returns the address to the pool where it can be reallocated as necessary.
  • 6. 6 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential DHCPv4 Concepts Steps to Obtain a Lease When the client boots (or otherwise wants to join a network), it begins a four-step process to obtain a lease: 1. DHCP Discover (DHCPDISCOVER) 2. DHCP Offer (DHCPOFFER) 3. DHCP Request (DHCPREQUEST) 4. DHCP Acknowledgment (DHCPACK)
  • 7. 7 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential DHCPv4 Concepts Steps to Renew a Lease Prior to lease expiration, the client begins a two- step process to renew the lease with the DHCPv4 server, as shown in the figure: 1. DHCP Request (DHCPREQUEST) Before the lease expires, the client sends a DHCPREQUEST message directly to the DHCPv4 server that originally offered the IPv4 address. If a DHCPACK is not received within a specified amount of time, the client broadcasts another DHCPREQUEST so that one of the other DHCPv4 servers can extend the lease. 2. DHCP Acknowledgment (DHCPACK) On receiving the DHCPREQUEST message, the server verifies the lease information by returning a DHCPACK. Note: These messages (primarily the DHCPOFFER and DHCPACK) can be sent as unicast or broadcast according to IETF RFC 2131.
  • 8. 8 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7.2 Configure a Cisco IOS DHCPv4 Server
  • 9. 9 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Cisco IOS DHCPv4 Server Now you have a basic understanding of how DHCPv4 works and how it can make your job a bit easier. A Cisco router running Cisco IOS software can be configured to act as a DHCPv4 server. The Cisco IOS DHCPv4 server assigns and manages IPv4 addresses from specified address pools within the router to DHCPv4 clients.
  • 10. 10 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Steps to Configure a Cisco IOS DHCPv4 Server Use the following steps to configure a Cisco IOS DHCPv4 server: • Step 1. Exclude IPv4 addresses. A single address or a range of addresses can be excluded by specifying the low-address and high-address of the range. Excluded addresses should be those addresses that are assigned to routers, servers, printers, and other devices that have been, or will be, manually configured. You can also enter the command multiple times. The command is ip dhcp excluded-address low- address [high-address] • Step 2. Define a DHCPv4 pool name. The ip dhcp pool pool-name command creates a pool with the specified name and puts the router in DHCPv4 configuration mode, which is identified by the prompt Router(dhcp-config)#.
  • 11. 11 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Steps to Configure a Cisco IOS DHCPv4 Server (Cont.) • Step 3. Configure the DHCPv4 pool. The address pool and default gateway router must be configured. Use the network statement to define the range of available addresses. Use the default-router command to define the default gateway router. These commands and other optional commands are shown in the table. Task IOS Command Define the address pool. network network-number [mask | / prefix-length] Define the default router or gateway. default-router address [ address2….address8] Define a DNS server. dns-server address [ address2…address8] Define the domain name. domain-name domain Define the duration of the DHCP lease. lease {days [hours [ minutes]] | infinite} Define the NetBIOS WINS server. netbios-name-server address [ address2…address8]
  • 12. 12 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Configuration Example
  • 13. 13 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server DHCPv4 Verification Use the commands in the table to verify that the Cisco IOS DHCPv4 server is operational. Command Description show running-config | section dhcp Displays the DHCPv4 commands configured on the router. show ip dhcp binding Displays a list of all IPv4 address to MAC address bindings provided by the DHCPv4 service. show ip dhcp server statistics Displays count information regarding the number of DHCPv4 messages that have been sent and received
  • 14. 14 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Verify DHCPv4 is Operational Verify the DHCPv4 Configuration: As shown in the example, the show running-config | section dhcp command output displays the DHCPv4 commands configured on R1. The | section parameter displays only the commands associated with DHCPv4 configuration.
  • 15. 15 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Verify DHCPv4 is Operational (Cont.) Verify DHCPv4 Bindings: As shown in the example, the operation of DHCPv4 can be verified using the show ip dhcp binding command. This command displays a list of all IPv4 address to MAC address bindings that have been provided by the DHCPv4 service.
  • 16. 16 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Verify DHCPv4 is Operational (Cont.) Verify DHCPv4 Statistics: The output of the show ip dhcp server statistics is used to verify that messages are being received or sent by the router. This command displays count information regarding the number of DHCPv4 messages that have been sent and received.
  • 17. 17 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Verify DHCPv4 is Operational (Cont.) Verify DHCPv4 Client Received IPv4 Addressing: The ipconfig /all command, when issued on PC1, displays the TCP/IP parameters, as shown in the example. Because PC1 was connected to the network segment 192.168.10.0/24, it automatically received a DNS suffix, IPv4 address, subnet mask, default gateway, and DNS server address from that pool. No DHCP-specific router interface configuration is required. If a PC is connected to a network segment that has a DHCPv4 pool available, the PC can obtain an IPv4 address from the appropriate pool automatically.
  • 18. 18 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Disable the Cisco IOS DHCPv4 Server The DHCPv4 service is enabled by default. To disable the service, use the no service dhcp global configuration mode command. Use the service dhcp global configuration mode command to re- enable the DHCPv4 server process, as shown in the example. Enabling the service has no effect if the parameters are not configured. Note: Clearing the DHCP bindings or stopping and restarting the DHCP service may result in duplicate IP addresses being temporarily assigned on the network.
  • 19. 19 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server DHCPv4 Relay • In a complex hierarchical network, enterprise servers are usually located centrally. These servers may provide DHCP, DNS, TFTP, and FTP services for the network. Network clients are not typically on the same subnet as those servers. In order to locate the servers and receive services, clients often use broadcast messages. • In the figure, PC1 is attempting to acquire an IPv4 address from a DHCPv4 server using a broadcast message. In this scenario, R1 is not configured as a DHCPv4 server and does not forward the broadcast. Because the DHCPv4 server is located on a different network, PC1 cannot receive an IP address using DHCP. R1 must be configured to relay DHCPv4 messages to the DHCPv4 server.
  • 20. 20 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server DHCPv4 Relay (Cont.) • Configure R1 with the ip helper-address address interface configuration command. This will cause R1 to relay DHCPv4 broadcasts to the DHCPv4 server. As shown in the example, the interface on R1 receiving the broadcast from PC1 is configured to relay DHCPv4 address to the DHCPv4 server at 192.168.11.6. • When R1 has been configured as a DHCPv4 relay agent, it accepts broadcast requests for the DHCPv4 service and then forwards those requests as a unicast to the IPv4 address 192.168.11.6. The network administrator can use the show ip interface command to verify the configuration.
  • 21. 21 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Other Service Broadcasts Relayed DHCPv4 is not the only service that the router can be configured to relay. By default, the ip helper-address command forwards the following eight UDP services: • Port 37: Time • Port 49: TACACS • Port 53: DNS • Port 67: DHCP/BOOTP server • Port 68: DHCP/BOOTP client • Port 69: TFTP • Port 137: NetBIOS name service • Port 138: NetBIOS datagram service
  • 22. 22 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a Cisco IOS DHCPv4 Server Packet Tracer – Configure DHCPv4 In this Packet Tracer Activity, you will complete the following objectives: • Part 1: Configure a Router as a DHCP Server • Part 2: Configure DHCP Relay • Part 3: Configure a Router as a DHCP Client • Part 4: Verify DHCP and Connectivity
  • 23. 23 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7.3 Configure a DHCPv4 Client
  • 24. 24 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a DHCPv4 Client Cisco Router as a DHCPv4 Client There are scenarios where you might have access to a DHCP server through your ISP. In these instances, you can configure a Cisco IOS router as a DHCPv4 client. • Sometimes, Cisco routers in a small office or home office (SOHO) and branch sites have to be configured as DHCPv4 clients in a similar manner to client computers. The method used depends on the ISP. However, in its simplest configuration, the Ethernet interface is used to connect to a cable or DSL modem. • To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command. • In the figure, assume that an ISP has been configured to provide select customers with IP addresses from the 209.165.201.0/27 network range after the G0/0/1 interface is configured with the ip address dhcp command.
  • 25. 25 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a DHCPv4 Client Configuration Example • To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command, as shown in the example. This configuration assumes that the ISP has been configured to provide select customers with IPv4 addressing information. • The show ip interface g0/1 command confirms that the interface is up and that the address was allocated by a DHCPv4 server.
  • 26. 26 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Configure a DHCPv4 Client Home Router as a DHCPv4 Client Home routers are typically already set to receive IPv4 addressing information automatically from the ISP. This is so that customers can easily set up the router and connect to the internet. • For example, the figure shows the default WAN setup page for a Packet Tracer wireless router. Notice that the internet connection type is set to Automatic Configuration - DHCP. This selection is used when the router is connected to a DSL or cable modem and acts as a DHCPv4 client, requesting an IPv4 address from the ISP. • Various manufacturers of home routers will have a similar setup.
  • 27. 27 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7.4 Module Practice and Quiz
  • 28. 28 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Module Practice and Quiz Packet Tracer – Implement DHCPv4 In this Packet Tracer, you will complete the following objectives: • Part 1: Configure a Router as a DCHP Server • Part 2: Configure DCHP Relay • Part 3: configure a Router as a DCHP Client
  • 29. 29 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Module Practice and Quiz Lab – Implement DHCPv4 In this lab, you will complete the following objectives:  Part 1: Build the Network and Configure Basic Device Settings  Part 2: Configure and Verify Two DHCPv4 Servers on R1  Part 3: Configure and Verify a DHCP Relay on R2
  • 30. 30 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Module Practice and Quiz What Did I Learn In This Module? • The DHCPv4 server dynamically assigns, or leases, an IPv4 address to a client from a pool of addresses for a limited period of time chosen by the server, or until the client no longer needs the address. • The DHCPv4 lease process begins with the client sending message requesting the services of a DHCP server. If there is a DHCPv4 server that receives the message it will respond with an IPv4 address and possible other network configuration information. • The client must contact the DHCP server periodically to extend the lease. This lease mechanism ensures that clients that move or power off do not keep addresses that they no longer need. • When the client boots (or otherwise wants to join a network), it begins a four-step process to obtain a lease: DHCPDISCOVER, then DHCPOFFER, then DHCPREQUEST, and finally DHCPACK. Prior to lease expiration, the client begins a two-step process to renew the lease with the DHCPv4 server: DHCPREQUEST then DHCPACK. • A Cisco router running Cisco IOS software can be configured to act as a DHCPv4 server. • Use the following steps to configure a Cisco IOS DHCPv4 server: exclude IPv4 addresses, define a DHCPv4 pool name, and configure the DHCPv4 pool. • Verify your configuration using the show running-config | section dhcp, show ip dhcp binding, and show ip dhcp server statistics commands. • The DHCPv4 service is enabled, by default. To disable the service, use the no service dhcp global configuration mode command.
  • 31. 31 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Module Practice and Quiz What Did I Learn In This Module? (Cont.) • Network clients are not typically on the same subnet as enterprise servers providing DHCP, DNS, TFTP, and FTP services for the network. In order to locate the servers and receive services, clients often use broadcast messages. The router must be configured to relay DHCPv4 messages to the DHCPv4 server. • The network administrator can configure the router with the ip helper-address address interface configuration command and use the show ip interface command to verify the configuration. • By default, the ip helper-address command forwards the following eight UDP services: • Port 37: Time • Port 49: TACACS • Port 53: DNS • Port 67: DHCP/BOOTP server • Port 68: DHCP/BOOTP client • Port 69: TFTP • Port 137: NetBIOS name service • Port 138: NetBIOS datagram service • To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command. • Home routers are typically already set to receive IPv4 addressing information automatically from the ISP. The internet connection type is set to Automatic Configuration - DHCP. This selection is used when the router is connected to a DSL or cable modem and acts as a DHCPv4 client, requesting an IPv4 address from the ISP.