CCNP Course Institute in Delhi

Tuesday, December 14, 2010

DHCP Troubleshooting CCNP Training in Delhi Gurgaon

Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192

 DHCP serves as one of the most common methods of assigning IP address information to
a network host. Specifically, DHCP allows a DHCP client to obtain an IP address, subnet
mask, default gateway IP address, DNS server IP address, and other types of IP address
information from a DHCP server.
If you have a cable modem or DSL connection in your home, your cable modem or DSL
router might obtain its IP address from your service provider via DHCP. In many corporate
networks, when a PC boots up, that PC receives its IP address configuration information
from a corporate DHCP server.
Basic DHCP Operation
Figure 10-2 illustrates the exchange of messages that occur as a DHCP client obtains
IP address information from a DHCP server.
Step 1. When a DHCP client initially boots, it has no IP address, default gateway, or
other such configuration information. Therefore, the way a DHCP client initially
communicates is by sending a broadcast message (that is, a DHCPDISCOVER
message) to a destination address of 255.255.255.255 in an attempt to
discover a DHCP server.
Step 2. When a DHCP server receives a DHCPDISCOVER message, it can respond
with a DHCPOFFER message. Because the DHCPDISCOVER message is sent
as a broadcast, more than one DHCP server might respond to this discover
request. However, the client typically selects the server that sent the first
DHCPOFFER response it received.
Key
Topic
DHCP Client DHCP Server
10.1.1.2
DHCPDISCOVER
Step 1
DHCPOFFER
Step 2
DHCPREQUEST
Step 3
DHCPACK
Step 4
Figure 10-2 Obtaining IP Address Information from a DHCP Server
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
310 CCNP TSHOOT 642-832 Official Certification Guide
Step 3. The DHCP client communicates with this selected server by sending a
DHCPREQUEST message asking the DHCP server to provide IP configuration
parameters.
Step 4. Finally, the DHCP server responds to the client with a DHCPACK message.
This DHCPACK message contains a collection of IP configuration parameters.
Notice that in Step 1, the DHCPDISCOVER message was sent as a broadcast. By default, a
broadcast cannot cross a router boundary. Therefore, if a client resides on a different network
than the DHCP server, the next-hop router of the client should be configured as a
DHCP relay agent. You can use the ip helper-address ip-address interface configuration
mode command to configure a router interface to relay DHCP requests to either a unicast
IP address or a directed broadcast address.
DHCP Configurations
To illustrate the configuration of DHCP, consider Figure 10-3 and Example 10-5. In the
figure, the DHCP client belongs to the 172.16.1.0/24 network, whereas the DHCP server
belongs to the 10.1.1.0/24 network. Router R1 is configured as a DHCP relay agent, using
the syntax shown in Example 10-5.
Example 10-5 DHCP Relay Agent Configuration
Key
Topic R1# conf term
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# service dhcp
R1(config)# interface fa 0/0
R1(config-if)# ip helper-address 10.1.1.1
In the configuration, notice the service dhcp command. This command enables the DHCP
service on the router, which must be enabled for the DHCP relay agent feature to function.
This command is typically not required, because the DHCP service is enabled by default;
however, when troubleshooting a DHCP relay agent issue, you might want to confirm that
the service is enabled. Also, the ip helper-address 10.1.1.1 command specifies the IP address
of the DHCP server, although the ip helper-address 10.1.1.255 command could
have been used instead. Specifically, 10.1.1.255 is the directed broadcast IP address for the
10.1.1.0/24 network. Although using a directed broadcast address might enable you to reach
all DHCP servers on a particular subnet, Cisco recommends that you use a specific IP
address as opposed to a directed broadcast. One reason for this recommendation is that a
directed broadcast causes all hosts on the target subnet to examine the DHCPDISCOVER
DHCPDISCOVER DHCPDISCOVER
Fa 0/0 Fa 0/1
.1 .1
DHCP Relay
172.16.1.0/24 Agent 10.1.1.0/24
DHCP Client DHCP Server
.2
R1
Figure 10-3 DHCP Relay Agent
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
Chapter 10: IP Services Troubleshooting 311
packet, even if those hosts are not DHCP servers. Yet another rationale for this recommendation
is that some routers block directed broadcasts (because of a potential security risk).
When you configure a router to act as a DHCP relay agent, realize that it relays a few other
broadcast types in addition to a DHCP message. Some other protocols that are forwarded
by a DHCP relay agent include the following:
■ TFTP
■ Domain Name System (DNS)
■ Internet Time Service (ITS)
■ NetBIOS name server
■ NetBIOS datagram server
■ BootP
■ TACACS
As a reference, Table 10-6 provides a comprehensive listing of DHCP message types you
might encounter while troubleshooting a DHCP issue.
Key
Topic
Table 10-6 DHCP Message Types
DHCP Message Description
DHCPDISCOVER A client sends this message in an attempt to locate a DHCP server. This
message is sent to a broadcast IP address of 255.255.255.255 using UDP
port 67.
DHCPOFFER A DHCP server sends this message in response to a DHCPDISCOVER
message using UDP port 68.
DHCPREQUEST This message is a request for IP configuration parameters sent from a
client to a specific DHCP server.
DHCPDECLINE This message is sent from a client to a DHCP server to inform the server
that an IP address is already in use on the network.
DHCPACK A DHCP server sends this message to a client and includes IP configuration
parameters.
DHCPNAK A DHCP server sends this message to a client and informs the client that
the DHCP server declines to provide the client with the requested IP
configuration information.
DHCPRELEASE A client sends this message to a DHCP server and informs the DHCP
server that the client has released its DHCP lease, thus allowing the
DHCP server to reassign the client IP address to another client.
DHCPINFORM This message is sent from a client to a DHCP server and requests IP configuration
parameters. Such a message might be sent from an access
server requesting IP configuration information for a remote client attaching
to the access server.
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
312 CCNP TSHOOT 642-832 Official Certification Guide
In addition to acting as a DHCP relay agent, a router might act as a DHCP client. Specifically,
the interface of a router might obtain its IP address from a DHCP server. Also, a
router can act as a DHCP server. The text that follows considers each scenario.
Figure 10-4 shows a router acting as a DHCP client, where the router’s Fast Ethernet 0/0
interface obtains its IP address from a DHCP server. Example 10-6 provides the configuration
for the router in the topology (that is, router R1). Notice the dhcp option used in the
ip address command, instead of the usual IP address and subnet mask information.
Example 10-6 DHCP Client Configuration
Key
Topic R1#conf term
R1(config)#int fa 0/0
R1(config-if)#ip address dhcp
Figure 10-5 shows a router acting as a DHCP server, and Example 10-7 shows the router
configuration. The ip dhcp excluded-address 10.8.8.1 command prevents DHCP from assigning
the 10.8.8.1 IP address to a client. This exclusion occurs because this IP address is
one of the interfaces of the router. The ip dhcp pool POOL-A command creates a DHCP
pool named POOL-A. This pool can hand out IP addresses from the 10.8.8.0/24 network,
with a default gateway of 10.8.8.1, a DNS server of 192.168.1.1, and a WINS server of
192.168.1.2.
Example 10-7 DHCP Server Configuration
Key
Topic R1#show run
...OUTPUT OMITTED...
ip dhcp excluded-address 10.8.8.1
!
ip dhcp pool POOL-A
network 10.8.8.0 255.255.255.0
default-router 10.8.8.1
dns-server 192.168.1.1
netbios-name-server 192.168.1.2
...OUTPUT OMITTED...
DHCPDISCOVER DHCP Server
DHCPOFFER
DHCPREQUEST
DHCPACK
Fa 0/0
R1
Figure 10-4 Router Acting as a DHCP Client
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
Chapter 10: IP Services Troubleshooting 313
DHCP Client
DHCPDISCOVER
DHCPOFFER
DHCPREQUEST
DHCPACK
Fa 0/0
.1
DHCP Server
Figure 10-5 Router Acting as a DHCP Server
Potential DHCP Troubleshooting Issues
When troubleshooting what you suspect might be a DHCP issue, consider the following
potential issues:
■ A router not forwarding broadcasts: By default, a router does not forward broadcasts,
including DHCPDISCOVER broadcast messages. Therefore, a router needs to
be explicitly configured to act as a DHCP relay agent if the DHCP client and DHCP
server are on different subnets.
■ DHCP pool out of IP addresses: A DHCP pool contains a finite number of addresses.
Once a DCHP pool becomes depleted, new DHCP requests are rejected.
■ Misconfiguration: The configuration of a DHCP server might be incorrect. For example,
the range of network addresses to be given out by a particular pool might be
incorrect, or the exclusion of addresses statically assigned to routers or DNS servers
might be incorrect.
■ Duplicate IP addresses: A DHCP server might hand out an IP address to a client
that is already statically assigned to another host on the network. These duplicate IP
addresses can cause connectivity issues for both the DHCP client and the host that
had been statically configured for the IP address.
■ Redundant services not communicating: Some DHCP servers can coexist with
other DHCP servers for redundancy. For this redundancy to function, these DHCP
servers need to communicate with one another. If this interserver communication
fails, the DHCP servers can hand out overlapping IP addresses to their clients.
Key
Topic
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
314 CCNP TSHOOT 642-832 Official Certification Guide
■ The “pull” nature of DHCP: When a DHCP client wants an IP address, it can request
an IP address from a DHCP server. However, the DHCP server has no ability to
initiate a change in the client IP address after the client obtains an IP address. In other
words, the DHCP client pulls information from the DHCP server, but the DHCP
server cannot push information to the DHCP client.
At this point in this section, you have reviewed basic DHCP operations and potential
DHCP troubleshooting targets. When you begin your troubleshooting efforts, you might
want to collect the following information to help you better isolate the underlying cause
of the DHCP issue you are investigating.
■ The configuration of the DHCP server: For example, confirm that the pools are
correctly defined with appropriate network addresses, default gateways, and other
relevant IP address information.
■ The configuration of the DHCP relay agent: For example, determine if the target
addresses a unicast IP address or a directed broadcast address.
■ Determine the size of a DHCP pool: Because a pool in a DHCP server accommodates
only a limited number of IP addresses, determine how many IP addresses (if
any) are still available from a given DHCP pool.
DHCP Troubleshooting Syntax
Table 10-7 provides a collection of commands that can be useful in troubleshooting a
DHCP issue.
Key
Topic
Key
Topic
Table 10-7 DHCP Troubleshooting Commands
Command Description
show ip dhcp conflict Identifies any IP address conflicts a router identifies, along
with the method the router used to identify the conflicts
(this is, via ping or gratuitous ARP)
show ip dhcp binding Displays IP addresses that an IOS DHCP server assigns,
their corresponding MAC addresses, and lease expirations
clear ip dhcp binding * Releases all current DHCP leases
clear ip dhcp conflict * Clears all currently identified DHCP conflicts
debug ip dhcp server events Provides real-time information about DHCP address assignments
and database updates
debug ip dhcp server packet Displays real-time decodes of DHCP packets
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
Chapter 10: IP Services Troubleshooting 315
Example 10-8 provides sample output from the show ip dhcp conflict command. The output
indicates a duplicate 172.16.1.3 IP address on the network, which the router discovered
via a ping. You can resolve this conflict by issuing the clear ip dhcp conflict *
command.
Example 10-8 show ip dhcp conflict Command Output
R1#show ip dhcp conflict
IP address Detection method Detection time
172.16.1.3 Ping Oct 15 2009 8:56 PM
Example 10-9 shows sample output from the show ip dhcp binding command. The output
indicates that an IP address of 10.1.1.2 was assigned to a DHCP client with a MAC address
of 3030.312e.3066.3163. You can release this DHCP lease with the clear ip dhcp binding
* command.
Table 10-7 DHCP Troubleshooting Commands
Command Description
ip helper-address ip-address Interface configuration mode command that causes an interface
to forward specific received UDP broadcasts to the
destination IP address, which can be either a specific IP address
or a directed broadcast address
ip dhcp excluded-address
beginning-ip-address [endingip-
address]
Specifies a range of IP addresses not to be assigned to
DHCP clients
ip dhcp pool pool-name Creates a DHCP pool
network network-address
subnet-mask
Identifies a subnet to be used by a DHCP pool
default-router ip-address Specifies the IP address of a default gateway to be given to
a DHCP client
dns-server ip-address Configures the IP address of a DNS server to be given to a
DHCP client
netbios-name-server ipaddress
Defines the IP address of a WINS server to be given to a
DHCP client
lease {days hours minutes |
infinite}
Determines the duration of a DHCP lease given to a DHCP
client
www.CareerCert.info
www.CareerCert.info
www - CareerCert - info
316 CCNP TSHOOT 642-832 Official Certification Guide
Example 10-9 show ip dhcp binding Command Output
R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type Hardware address/
User name
10.1.1.2 0063.6973.636f.2d63.Oct 03 2009 12:03 PM Automatic 3030.312e.3066.3163.
0e30.3030.302d.4661.
Example 10-10 shows sample output from the debug ip dhcp server events command.
The output shows updates to the DHCP database.
Example 10-10 debug ip dhcp server events Command Output
R1#debug ip dhcp server events
*Mar 1 00:06:47.427: DHCPD: Seeing if there is an internally specified pool class:
*Mar 1 00:06:47.431: DHCPD: htype 1 chaddr c001.0f1c.0000
*Mar 1 00:06:47.431: DHCPD: remote id 020a00000a01010101000000
*Mar 1 00:06:47.435: DHCPD: circuit id 00000000
*Mar 1 00:06:49.415: DHCPD: Seeing if there is an internally specified pool class:
*Mar 1 00:06:49.419: DHCPD: htype 1 chaddr c001.0f1c.0000
*Mar 1 00:06:49.419: DHCPD: remote id 020a00000a01010101000000
*Mar 1 00:06:49.423: DHCPD: circuit id 00000000
*Mar 1 00:06:52.603: DHCPD: no subnet configured for 192.168.1.238.
Example 10-11 shows sample output from the debug ip dhcp server packet command.
The output shows a DHCPRELEASE message being received when a DHCP client with an
IP address of 10.1.1.3 is shut down. You can also see the four-step process of a DHCP
client obtaining an IP address of 10.1.1.4 with the following messages: DHCPDISCOVER,
DHCPOFFER, DHCPREQUEST, and DHCPACK.

No comments:

Post a Comment