SRWE Module 7 DHCPv4 PDF
Document Details
Uploaded by PreciousDallas5991
KdG
Tags
Summary
This document provides information on DHCPv4 concepts, server and client configuration, and DHCPv4 relay. The document includes practical examples illustrating the configuration of a DHCPv4 server and client within a network.
Full Transcript
Module 7: DHCPv4 Switching, Routing and Wireless Essentials v7.0 (SRWE) Module Objectives Module Title: DHCPv4 Module Objective: Implement DHCPv4 to operate across multiple LANs Topic Title Topic Objective Explain how DHCPv4 ope...
Module 7: DHCPv4 Switching, Routing and Wireless Essentials v7.0 (SRWE) Module Objectives Module Title: DHCPv4 Module Objective: Implement DHCPv4 to operate across multiple LANs Topic Title Topic Objective Explain how DHCPv4 operates in a small- to DHCP4 Concepts medium-sized business network. Configure a Cisco IOS DHCP4 Configure a router as a DHCPv4 server. Server Configure a DHCP4 Client Configure a router as a DHCPv4 client. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2 7.1 DHCPv4 Concepts 3 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5 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)= Accept 4. DHCP Acknowledgment (DHCPACK) © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6 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. Note: These messages (primarily the DHCPOFFER and DHCPACK) can be sent as unicast or broadcast according 2. DHCP Acknowledgment (DHCPACK) to IETF RFC 2131. On receiving the DHCPREQUEST message, the server verifies the lease information by returning a DHCPACK. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7 7.2 Configure a Cisco IOS DHCPv4 Server 8 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)#. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9 Configure a Cisco IOS DHCPv4 Server Configuration Example © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10 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. Displays a list of all IPv4 address to MAC address bindings provided by the show ip dhcp binding DHCPv4 service. Displays count information regarding the number of DHCPv4 messages show ip dhcp server statistics that have been sent and received © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16 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 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17 7.3 Configure a DHCPv4 Client 18 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. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19