Understanding DHCP

Dynamic Host Configuration Protocol (DHCP) is a service that can run on either a router or a server. Its function is to automate the process of assigning IP addresses, subnet masks, default gateways, and other settings to computers. It also helps prevent IP address conflicts by keeping track of which IP addresses have been issued and which have not. This section discusses the operation of DHCP in any form and then looks at how DHCP is implemented on a Cisco router.

Operations

Before a DHCP server or router can function, the service must be enabled and an IP address range or scope must be created. A scope is a set of IP addresses that the DHCP server or router will use to issue IP addresses. The DHCP server will issue these addresses on a first-come, first-served basis and will mark an address when it is assigned to prevent duplicates.

Computers must be set to participate in the DHCP process to obtain an address. This is done by selecting the check box to obtain an IP address automatically in the Properties of TCP/IP on the computers, as shown in Figure 7.4.

images

FIGURE 7.4 DHCP settings

You may have noticed that the computer is not configured with the IP address of the DHCP server or router. When a computer is set to use a DHCP server, it will broadcast to locate the DHCP server. The server will answer and offer an IP address if it has one, and the computer will accept the address and begin to use it. There are four packets that will go back and forth between the DHCP server or router and the DHCP client, as shown in Figure 7.5.

images

FIGURE 7.5 DHCP process

Many settings can be issued using DHCP. The most common are as follows:

  • IP address
  • Subnet mask
  • Default gateway
  • DNS server

Cisco DHCP

A Cisco router also has the ability to act as a DHCP server for the computers on the local LAN. As you learned earlier, routers connect LANs via physical Ethernet interfaces. The computers do not usually connect directly to this interface; instead, a switch is connected to the interface and computers are then connected to the switch, as shown in Figure 7.6.

images

FIGURE 7.6 Router and switch layout

DHCP is configured on the router and will function on the interface that is the same LAN as the scope. For example, if the scope range is from 196.168.2.2– 192.168.2.50 and the E1 interface has an IP address of 192.168.2.1, computers on the LAN connected to the switch connected to E1 will receive an answer to their DHCP request. Computers connected to the switch connected to E2, which has an IP address of 10.1.1.1, will not receive an answer unless a scope is configured for that network, such as 10.1.1.2–10.1.1.50. In Chapter 13, you will learn the commands to enable DHCP for an interface.

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

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