Chapter 7

DHCPv4

Objectives

Upon completion of this chapter, you will be able to answer the following questions:

  • How does DHCPv4 operate in a small- to medium-sized business network?

  • How do you configure a router as a DHCPv4 server?

  • How do you configure a router as a DHCPv4 client?

Key Terms

This chapter uses the following key terms. You can find the definitions in the Glossary.

Dynamic Host Configuration Protocol (DHCP) Page 200

DHCPv4 Page 200

DHCPv4 server Page 200

lease Page 200

DHCPv4 client Page 201

DHCP Discover (DHCPDISCOVER) Page 201

DHCP Offer (DHCPOFFER) Page 201

DHCP Request (DHCPREQUEST) Page 201

DHCP Acknowledgment (DHCPACK) Page 201

Cisco IOS helper address Page 212

DHCPv4 relay agent Page 212

Introduction (7.0)

The Dynamic Host Configuration Protocol (DHCP) dynamically assigns IPv4 addresses to devices. DHCPv4 is for an IPv4 network. (Don’t worry, you’ll learn about DHCPv6 in another module.) This means that you, the network administrator, do not have to spend your day configuring IPv4 addresses for every device on your network. In a small home or office, that would not be very difficult, but any large network might have hundreds, or even thousands of devices.

In this module, you learn how to configure a Cisco IOS router to be a DHCPv4 server. Then you learn how to configure a Cisco IOS router as a client. This module includes a few Syntax Checkers and a Packet Tracer activity to help you try out your new knowledge. DHCPv4 configuration skills will significantly reduce your workload, and who doesn’t want that?

DHCPv4 Concepts (7.1)

All hosts in a network require an IPv4 configuration. Although some devices will have their IPv4 configuration statically assigned, most devices will use DHCP to acquire a valid IPv4 configuration. Therefore, DHCP is a vital feature that must be managed and carefully implemented.

In this section, you learn how to implement DHCPv4 to operate across multiple LANs in a small- to medium-sized business network.

DHCPv4 Server and Client (7.1.1)

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 small office or home office (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.

In Figure 7-1, the DHCPv4 client requests DHCPv4 services. The DHCPv4 server responds with network configuration information.

A simple communication between a DHCPv4 server and client is presented.

Figure 7-1 DHCPv4 Server and Client Topology

DHCPv4 Operation (7.1.2)

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.

Steps to Obtain a Lease (7.1.3)

When the client boots (or otherwise wants to join a network), it begins a four-step process to obtain a lease:

Step 1. DHCP Discover (DHCPDISCOVER)

Step 2. DHCP Offer (DHCPOFFER)

Step 3. DHCP Request (DHCPREQUEST)

Step 4. DHCP Acknowledgment (DHCPACK)

This four-step process is summarized in Figure 7-2.

The steps involved in a DHCP client obtaining lease from DHCP server are presented.

Figure 7-2 Four Steps to Obtain a Lease

Step 1. DHCP Discover (DHCPDISCOVER). The client starts the process using a broadcast DHCPDISCOVER message with its own MAC address to discover available DHCPv4 servers. Because the client has no valid IPv4 information at boot, it uses Layer 2 and Layer 3 broadcast addresses to communicate with the server. The purpose of the DHCPDISCOVER message is to find DHCPv4 servers on the network.

Step 2. DHCP Offer (DHCPOFFER). When the DHCPv4 server receives a DHCPDISCOVER message, it reserves an available IPv4 address to lease to the client. The server also creates an ARP entry consisting of the MAC address of the requesting client and the leased IPv4 address of the client. The DHCPv4 server sends the binding DHCPOFFER message to the requesting client. The DHCPOFFER message can be sent as a broadcast or a unicast message.

Step 3. DHCP Request (DHCPREQUEST). When the client receives the DHCPOFFER from the server, it sends back a DHCPREQUEST message. This message is used for both lease origination and lease renewal. When used for lease origination, the DHCPREQUEST serves as a binding acceptance notice to the selected server for the parameters it has offered and an implicit decline to any other servers that may have provided the client a binding offer.

Many enterprise networks use multiple DHCPv4 servers. The DHCPREQUEST message is sent in the form of a broadcast to inform this DHCPv4 server and any other DHCPv4 servers about the accepted offer.

Step 4. DHCP Acknowledgment (DHCPACK). On receiving the DHCPREQUEST message, the server may verify the lease information with an Internet Control Message Protocol (ICMP) ping to that address to ensure it is not being used already, it will create a new address resolution protocol (ARP) entry for the client lease, and reply with a DHCPACK message. The DHCPACK message is a duplicate of the DHCPOFFER, except for a change in the message type field. When the client receives the DHCPACK message, it logs the configuration information and may perform an ARP lookup for the assigned address. If there is no reply to the ARP, the client knows that the IPv4 address is valid and starts using it as its own.

Steps to Renew a Lease (7.1.4)

Prior to lease expiration, the client begins a two-step process to renew the lease with the DHCPv4 server, as shown in Figure 7-3.

The steps involved in renewing an obtained lease are shown.

Figure 7-3 Two Steps to Renew a Lease

Step 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.

Step 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.

Check Your Understanding—DHCPv4 Concepts (7.1.5)

Interactive Graphic.

Refer to the online course to complete this activity.

Configure a Cisco IOS DHCPv4 Server (7.2)

In this section, you learn how to configure a router as a DHCPv4 server.

Cisco IOS DHCPv4 Server (7.2.1)

Now you have a basic understanding of how DHCPv4 works and how it can make your job a bit easier. If you do not have a separate DHCPv4 server, this section shows you how to configure a Cisco IOS router to act as one. A Cisco router running Cisco IOS software can be configured to act as a DHCPv4 server, as shown in Figure 7-4. The Cisco IOS DHCPv4 server assigns and manages IPv4 addresses from specified address pools within the router to DHCPv4 clients.

A network setup represents a DHCPv4 server topology.

Figure 7-4 Cisco IOS DHCPv4 Server Topology

Steps to Configure a Cisco IOS DHCPv4 Server (7.2.2)

Use the following steps to configure a Cisco IOS DHCPv4 server.

Step 1. Exclude IPv4 Addresses

The router functioning as the DHCPv4 server assigns all IPv4 addresses in a DHCPv4 address pool unless it is configured to exclude specific addresses. Typically, some IPv4 addresses in a pool are assigned to network devices that require static address assignments. Therefore, these IPv4 addresses should not be assigned to other devices. The command syntax to exclude IPv4 addresses is the following:

Router(config)# ip dhcp excluded-address low-address [high-address]

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.

Step 2. Define a DHCPv4 Pool Name

Configuring a DHCPv4 server involves defining a pool of addresses to assign.

As shown in the example, 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)#.

The command syntax to define the pool is the following:

Router(config)# ip dhcp pool pool-name

Router(dhcp-config)#

Step 3. Configure the DHCPv4 Pool

Table 7-1 lists the tasks to complete the DHCPv4 pool configuration.

Table 7-1 DHCPv4 Configuration Commands

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]

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. Typically, the gateway is the LAN interface of the router closest to the client devices. One gateway is required, but you can list up to eight addresses if there are multiple gateways.

Other DHCPv4 pool commands are optional. For example, the IPv4 address of the DNS server that is available to a DHCPv4 client is configured using the dns-server command. The domain-name command is used to define the domain name. The duration of the DHCPv4 lease can be changed using the lease command. The default lease value is one day. The netbios-name-server command is used to define the NetBIOS WINS server.

Note

Microsoft recommends using Domain Name System (DNS) for Windows name resolution instead of deploying WINS.

Configuration Example (7.2.3)

The topology for the example configuration is shown in Figure 7-5.

A network setup represents a DHCPv4 server topology.

Figure 7-5 Cisco IOS DHCPv4 Server Topology

Example 7-1 shows the configuration to make R1 a DHCPv4 server for the 192.168.10.0/24 LAN.

Example 7-1 Cisco IOS DHCPv4 Server Configuration for R1

R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.9
R1(config)# ip dhcp excluded-address 192.168.10.254
R1(config)# ip dhcp pool LAN-POOL-1
R1(dhcp-config)# network 192.168.10.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 192.168.11.5
R1(dhcp-config)# domain-name example.com
R1(dhcp-config)# end
R1#

DHCPv4 Verification Commands (7.2.4)

Use the commands in Table 7-2 to verify that the Cisco IOS DHCPv4 server is operational.

Table 7-2 DHCPv4 Verification Commands

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.

Verify DHCPv4 is Operational (7.2.5)

R1 in Figure 7-5 has been configured to provide DHCPv4 services. PC1 has not been powered up and, therefore, does not have an IPv4 address.

The output for the following commands assumes PC1 has received its IPv4 addressing information from the DHCPv4 server. You may need to enter ipconfig /renew on a Windows PC to force it to send out a DHCPDISCOVER message.

You can use several commands to verify DHCPv4 is operational.

Verify the DHCPv4 Configuration

As shown in Example 7-2, the show running-config | section dhcp command output displays the DHCPv4 commands configured on R1. The | section dhcp parameter displays only the commands associated with DHCPv4 configuration.

Example 7-2 Verify the DHCPv4 Configuration

R1# show running-config | section dhcp
ip dhcp excluded-address 192.168.10.1 192.168.10.9
ip dhcp excluded-address 192.168.10.254
ip dhcp pool LAN-POOL-1
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
 dns-server 192.168.11.5
 domain-name example.com
Verify DHCPv4 Bindings

As shown in Example 7-3, 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.

Example 7-3 Verify the DHCPv4 Bindings

R1# show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address    Client-ID/         Lease expiration     Type       State  Interface
              Hardware address/
              User name
192.168.10.10 0100.5056.b3ed.d8   Sep 15 2019 8:42 AM  Automatic  Active
  GigabitEthernet0/0/0
Verify DHCPv4 Statistics

The output of the show ip dhcp server statistics command is used to verify that messages are being received or sent by the router, as shown in Example 7-4. This command displays count information regarding the number of DHCPv4 messages that have been sent and received.

Example 7-4 Verify DHCPv4 Statistics

R1# show ip dhcp server statistics
Memory usage          19465
Address pools         1
Database agents       0
Automatic bindings    2
Manual bindings       0
Expired bindings      0
Malformed messages    0
Secure arp entries    0
Renew messages        0
Workspace timeouts    0
Static routes         0
Relay bindings        0
Relay bindings active        0
Relay bindings terminated    0
Relay bindings selecting     0
Message              Received
BOOTREQUEST          0
DHCPDISCOVER         4
DHCPREQUEST          2
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0
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.

Example 7-5 Verify the DHCPv4 Client Configuration

C:UsersStudent> ipconfig /all
Windows IP Configuration
   Host Name . . . . . . . . . . . . : ciscolab
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . : example.com
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : 00-05-9A-3C-7A-00
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 192.168.10.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained  . . . . . . . . . : Saturday, September 14, 2019 8:42:22AM
   Lease Expires   . . . . . . . . . : Sunday, September 15, 2019 8:42:22AM
   Default Gateway . . . . . . . . . : 192.168.10.1
   DHCP Server . . . . . . . .. . .  : 192.168.10.1
   DNS Servers . . . . . . . .. . .  : 192.168.11.5

Syntax Checker—Configure DHCPv4 (7.2.6)

Interactive Graphic.

In this Syntax Checker activity, you configure R1 to be the DHCPv4 server for the 192.168.11.0/24 network.

Refer to the online course to complete this activity.

Disable the Cisco IOS DHCPv4 Server (7.2.7)

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 reenable the DHCPv4 server process, as shown in Example 7-6. Enabling the service has no effect if the parameters are not configured.

Example 7-6 Disable and Reenable DHCPv4 Service

R1(config)# no service dhcp
R1(config)# service dhcp
R1(config)#

Note

Clearing the DHCP bindings or stopping and restarting the DHCP service may result in duplicate IPv4 addresses being temporarily assigned on the network.

DHCPv4 Relay (7.2.8)

In a complex hierarchical network, enterprise servers are usually located centrally. These servers may provide DHCP, DNS, Trivial File Transfer Protocol (TFTP), and File Transfer Protocol (FTP) services for the network. Network clients are not typically on the same subnet as those servers. To locate the servers and receive services, clients often use broadcast messages.

In Figure 7-6, 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 IPv4 address using DHCP. R1 must be configured to relay DHCPv4 messages to the DHCPv4 server.

An illustration of DHCPv4 relay topology.

Figure 7-6 DHCPv4 Relay Topology

In this scenario, a network administrator is attempting to renew IPv4 addressing information for PC1. The following commands could be used by an administrator to resolve this issue.

The ipconfig /release Command

PC1 is a Windows computer. The network administrator releases all current IPv4 addressing information using the ipconfig /release command, as shown in Example 7-7. Notice that the IPv4 address is released and no address is shown.

Example 7-7 The ipconfig /release Command

C:UsersStudent> ipconfig /release
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . :
   Default Gateway . . . . . . . . . :
The ipconfig /renew Command

Next, the network administrator attempts to renew the IPv4 addressing information with the ipconfig /renew command, as shown in Example 7-8. This command causes PC1 to broadcast a DHCPDISCOVER message. The output shows that PC1 is unable to locate the DHCPv4 server. Because routers do not forward broadcasts, the request is not successful.

The network administrator could add DHCPv4 servers on R1 for all subnets. However, this would create additional cost and administrative overhead.

Example 7-8 The ipconfig /renew Command

C:UsersStudent> ipconfig /renew
Windows IP Configuration
An error occurred while renewing interface Ethernet0 : unable to connect to your
  DHCP server. Request has timed out.
The ip helper-address Command

A better solution is to configure R1 with the Cisco IOS helper address using the ip helper-address address interface configuration command. This will enable R1 to relay the DHCP client broadcast messages to the DHCPv4 server.

As shown in Example 7-9, the interface on R1 receiving the broadcast from PC1 is configured to relay DHCPv4 address to the DHCPv4 server at 192.168.11.6.

Example 7-9 The ip helper-address Command

R1(config)# interface g0/0/0
R1(config-if)# ip helper-address 192.168.11.6
R1(config-if)# end
R1#
The show ip interface Command

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, as shown in Example 7-10.

Example 7-10 The show ip interface Command

R1# show ip interface g0/0/0
GigabitEthernet0/0/0 is up, line protocol is up
  Internet address is 192.168.10.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is 192.168.11.6
(output omitted)
The ipconfig /all Command

As shown in Example 7-11, PC1 is now able to acquire an IPv4 address from the DHCPv4 server as verified with the ipconfig /all command.

Example 7-11 The ipconfig /all Command

C:UsersStudent> ipconfig /all
Windows IP Configuration

Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  .  : example.com
   IPv4 Address. . . . . . . . . . . : 192.168.10.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.10.1
(output omitted)

Other Service Broadcasts Relayed (7.2.9)

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

Packet Tracer—Configure DHCPv4 (7.2.10)

Packet Tracer Activity.

In this Packet Tracer Activity, you 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

Configure a DHCPv4 Client (7.3)

In this section, you learn how to configure a router as a DHCPv4 client.

Cisco Router as a DHCPv4 Client (7.3.1)

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. This section guides you through this process.

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 Digital Subscriber Line (DSL) modem.

To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command.

In Figure 7-7, assume that an ISP has been configured to provide select customers with IPv4 addresses from the 209.165.201.0/27 network range after the G0/0/1 interface is configured with the ip address dhcp command.

A network setup where a router is a DHCP client.

Figure 7-7 Topology with Router as a DHCPv4 Client

Configuration Example (7.3.2)

To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command, as shown in Example 7-12. This configuration assumes that the ISP has been configured to provide select customers with IPv4 addressing information.

Example 7-12 Router as a DHCPv4 Client Configuration

SOHO(config)# interface G0/0/1
SOHO(config-if)# ip address dhcp
SOHO(config-if)# no shutdown
Sep 12 10:01:25.773: %DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0/1
  assigned DHCP address 209.165.201.12, mask 255.255.255.224, hostname SOHO

The show ip interface g0/0/1 command confirms that the interface is up and that the address was allocated by a DHCPv4 server, as shown in Example 7-13.

Example 7-13 Verify the Router Received IPv4 Addressing Information

SOHO# show ip interface g0/0/1
GigabitEthernet0/0/1 is up, line protocol is up
  Internet address is 209.165.201.12/27
  Broadcast address is 255.255.255.255
  Address determined by DHCP
(output omitted)

Home Router as a DHCPv4 Client (7.3.3)

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, Figure 7-8 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.

A screenshot of a WAN setup page is shown.

Figure 7-8 Configuring a Home Router as a DHCPv4 Client

Syntax Checker—Configure a Cisco Router as DHCP Client (7.3.4)

Interactive Graphic.

In this Syntax Checker activity, you configure a Cisco router as DHCP client.

Refer to the online course to complete this activity.

Summary (7.4)

The following is a summary of each section in the module:

DHCPv4 Concepts

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 a 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 the network, a four-step message exchange process is used between the client and the DHCPv4 server. Specifically, the DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, and DHCPACK messages are used for the client to obtain its IP addressing information from the DHCPv4 server.

Configure a Cisco IOS DHCPv4 Server

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. 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. To locate the servers and receive services, clients often use broadcast messages. A PC is attempting to acquire an IPv4 address from a DHCPv4 server using a broadcast message. If the router is not configured as a DHCPv4 server, it will not forward the broadcast. If the DHCPv4 server is located on a different network, the PC cannot receive an IPv4 address using DHCP. The router must be configured to relay DHCPv4 messages to the DHCPv4 server. The network administrator releases all current IPv4 addressing information using the ipconfig /release command. Next, the network administrator attempts to renew the IPv4 addressing information with the ipconfig /renew command. A better solution is to configure R1 with the ip helper-address address interface configuration command. The network administrator can use the show ip interface command to verify the configuration. The PC is now able to acquire an IPv4 address from the DHCPv4 server as verified with the ipconfig /all command. 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

Configure a DHCPv4 Client

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. 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.

Packet Tracer—Implement DHCPv4 (7.4.1)

Packet Tracer Activity.

As the network technician for your company, you are tasked with configuring a Cisco router as a DHCP server to provide dynamic allocation of addresses to clients on the network. You are also required to configure the edge router as a DHCP client so that it receives an IP address from the ISP network. Because the server is centralized, you will need to configure the two LAN routers to relay DHCP traffic between the LANs and the router that is serving as the DHCP server.

Lab—Implement DHCPv4 (7.4.2)

Notes icon.

In this lab, you 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

Practice

The following activities provide practice with the topics introduced in this chapter. The Labs are available in the companion Switching, Routing, and Wireless Essentials Labs and Study Guide (CCNAv7) (ISBN 9780136634386). The Packet Tracer Activity instructions are also in the Labs & Study Guide. The PKA files are found in the online course.

Lab

Notes icon.

Lab 7.4.2: Implement DHCPv4

Packet Tracer Activities

Packet Tracer Activity.

Packet Tracer 7.2.10: Configure DHCPv4

Packet Tracer 7.4.1: Implement DHCPv4

Check Your Understanding Questions

Complete all the review questions listed here to test your understanding of the sections and concepts in this chapter. The appendix “Answers to the ‘Check Your Understanding’ Questions” lists the answers.

1. Which DHCPv4 message will a client send to accept an IPv4 address that is offered by a DHCP server?

  1. Broadcast DHCPACK

  2. Broadcast DHCPREQUEST

  3. Unicast DHCPACK

  4. Unicast DHCPREQUEST

2. What is the reason why the DHCPREQUEST message is sent as a broadcast during the DHCPv4 process?

  1. For hosts on other subnets to receive the information

  2. For routers to fill their routing tables with this new information

  3. To notify other DHCP servers on the subnet that the IPv4 address was leased

  4. To notify other hosts not to request the same IPv4 address

3. Which address does a DHCPv4 server target when sending a DHCPOFFER message to a client that makes an address request?

  1. Broadcast MAC address

  2. Client MAC address

  3. Client IPv4 address

  4. Gateway IPv4 address

4. As a DHCPv4 client lease is about to expire, what is the message that the client sends the DHCP server?

  1. DHCPACK

  2. DHCPDISCOVER

  3. DHCPOFFER

  4. DHCPREQUEST

5. What is an advantage of configuring a Cisco router as a relay agent?

  1. It can forward both broadcast and multicast messages on behalf of clients.

  2. It can provide relay services for multiple UDP services.

  3. It reduces the response time from a DHCP server.

  4. It will allow DHCPDISCOVER messages to pass without alteration.

6. An administrator issues the ip address dhcp command on interface G0/0/1. What is the administrator trying to achieve?

  1. Configuring the router to act as a DHCPv4 server

  2. Configuring the router to act as a relay agent

  3. Configuring the router to obtain IPv4 parameters from a DHCPv4 server

  4. Configuring the router to resolve IPv4 address conflicts

7. Under which two circumstances would a router usually be configured as a DHCPv4 client? (Choose two.)

  1. The administrator needs the router to act as a relay agent.

  2. This is an ISP requirement.

  3. The router has a fixed IPv4 address.

  4. The router is intended to be used as a SOHO gateway.

  5. The router is meant to provide IPv4 addresses to the hosts.

8. A host on the 10.10.100.0/24 LAN is not being assigned an IPv4 address by an enterprise DHCP server with the address 10.10.200.10/24. What is the best way for the network engineer to resolve this problem?

  1. Issue the default-router 10.10.200.10 command at the DHCP configuration prompt on the 10.10.100.0/24 LAN gateway router.

  2. Issue the ip helper-address 10.10.100.0 command on the router interface that is the 10.10.200.0/24 gateway.

  3. Issue the ip helper-address 10.10.200.10 command on the router interface that is the 10.10.100.0/24 gateway.

  4. Issue the network 10.10.200.0 255.255.255.0 command at the DHCP configuration prompt on the 10.10.100.0/24 LAN gateway router.

9. What is accomplished by the ip dhcp excluded-address 10.10.4.1 10.10.4.5 command?

  1. The DHCP server will ignore all traffic from clients with IPv4 addresses 10.10.4.1 to 10.10.4.5.

  2. The DHCP server will not issue IPv4 addresses ranging from 10.10.4.1 to 10.10.4.5.

  3. Traffic destined for 10.10.4.1 to 10.10.4.5 will be denied.

  4. Traffic from clients with IPv4 addresses 10.10.4.1 to 10.10.4.5 will be denied.

10. Which Windows command combination would enable a DHCPv4 client to reinstate its IPv4 configuration?

  1. Enter ip config /release and then ip config /autonegotiate

  2. Enter ip config /release and then ip config /renew

  3. Enter ipconfig /release and then ipconfig /autonegotiate

  4. Enter ipconfig /release and then ipconfig /renew

11. Which command issued on R1 can be used to verify the current IPv4 address and MAC address binding?

  1. R1# show ip dhcp binding

  2. R1# show ip dhcp pool

  3. R1# show ip dhcp server statistics

  4. R1# show running-config | section dhcp

12. Which DHCP operation statement is true?

  1. A DHCP client must wait for lease expiration before sending a new DHCPREQUEST message.

  2. If a DHCP client receives several DHCPOFFER messages from different servers, it sends a unicast DHCPACK message to the selected server.

  3. The DHCPDISCOVER message contains the IPv4 address and subnet mask to be assigned, the IPv4 address of the DNS server, and the IPv4 address of the default gateway.

  4. When a DHCP client boots, it broadcasts a DHCPDISCOVER message to identify an available DHCP server on the network.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.218.230