Upload
chetan666123
View
237
Download
4
Embed Size (px)
DESCRIPTION
bsbfdbdfbbf
Citation preview
Cisco certification training
Instructor:- ASHOK TAMBE
Contact us :- 9930157345 ashok tambe
Training for
CCNA,CCNP,
CCNA SECURITY
CCIP,
MPLS, BGP, IPV6
NETWORK+, SEURITY+
Instructor:- ASHOK TAMBE
Cisco certification training
Copyright© 2015 NETworkingWANschool
CCNA 200-120
https://www.facebook.com/Networkingwanschool
Copyright© 2015 NETworkingWANschool
CCNA 200-120
Instructor:- ASHOK TAMBE
Configure and verify DHCP (IOS Router)
What is DHCP?
Every device that connects to a network needs an IP address. Network administrators assign static IP addresses to routers, servers, and other network devices whose locations (physical and logical) are not likely to change. Administrators enter static IP addresses manually when they configure devices to join the network. Static addresses also enable administrators to manage those devices remotely. However, computers in an organization often change locations, physically and logically. Administrators are unable to keep up with having to assign new IP addresses every time an employee moves to a different office or cubicle. Desktop clients do not require a static address. Instead, a workstation can use any address within a range of addresses. This range is typically within an IP subnet. A workstation within a specific subnet can be assigned any address within a specified range. Other items such as the subnet mask, default gateway, and Domain Name System (DNS) server are assigned a value which is common either to that subnet or entire administrated network. For example, all hosts within the same subnet will receive different host IP addresses, but will receive the same subnet mask and default gateway IP address."
DHCP makes the process of assigning new IP addresses almost transparent. DHCP assigns IP addresses and other important network configuration information dynamically. Because desktop clients typically make up the bulk of network nodes, DHCP is an extremely useful and timesaving tool for network administrators.
DHCP Operation
Providing IP addresses to clients is the most fundamental task performed by a DHCP server. DHCP includes three different address allocation mechanisms to provide flexibility when assigning IP addresses: Manual Allocation: The administrator assigns a pre-allocated IP address to the client and DHCP only communicates the IP address to the device. Automatic Allocation: DHCP automatically assigns a static IP address permanently to a device, selecting it from a pool of available addresses. There is no lease and the address is permanently assigned to a device. Dynamic Allocation: DHCP automatically dynamically assigns, or leases, an IP address from a pool of addresses for a limited period of time chosen by the server, or until the client tells the DHCP server that it no longer needs the address.
This section focuses on dynamic allocation.
DHCP works in a client/server mode and operates like any other client/server relationship.
When a PC connects to a DHCP server, the server assigns or leases an IP address
to that PC. The PC connects to the network with that leased IP address until the lease
expires. The host must contact the DHCP server periodically to extend the lease. This lease mechanism ensures that hosts that move or power off do not hold
onto addresses that they do not need. The DHCP server returns these addresses to the address pool and reallocates
them as necessary.
The DHCP process to lease an IP address uses the following four messages between
the client and server. (Also, as a way to help remember the messages, note that the
first letters spell DORA):
Discover: Sent by the DHCP client to find a willing DHCP server
Offer: Sent by a DHCP server to offer to lease to that client a
specific IP address (and inform the client of its other parameters)
Request: Sent by the DHCP client to ask the server to lease the
IPv4 address listed in the Offer message
Acknowledgment: Sent by the DHCP Server to assign the
address, and to list the mask, default router, and DNS server IP
addresses
DHCP clients, however, have a somewhat unique problem: they do not have an IP
address yet, but they need to send IP packets. To make that work, DHCP messages
make use of two special IPv4 addresses that allow a host that has no IP address still
be able to send and receive messages on the local subnet:
0.0.0.0: An address reserved for use as a source IPv4 address for hosts that do not
yet have an IP address.
255.255.255.255: The address reserved as a local subnet broadcast address.
Packets sent to this destination address are broadcast on the local data link, but routers do not forward them to other subnets.
When the client boots or otherwise wants to join a network, it completes four steps in obtaining a lease. In the first step, the client broadcasts a DHCPDISCOVER message. The DHCPDISCOVER message finds DHCP servers on the network. Because the host has no valid IP information at bootup, it uses L2 and L3 broadcast addresses to communicate with the server.
When the DHCP server receives a DHCDISCOVER message, it finds an available IP address to lease, creates an ARP entry consisting of the MAC address of the requesting host and the leased IP address, and transmits a binding offer with a DHCPOFFER message. The DHCPOFFER message is sent as a unicast, using the L2 MAC address of the server as the source address and the L2 address of the client as the destination.
When the client receives the DHCPOFFER from the server, it sends back a DHCPREQUEST message. This message has two purposes: lease origination and lease renewal and verification. When used for lease origination, the DHCPREQUEST of the client is requesting that the IP information be verified just after it has been assigned. The message provides error checking to ensure that the assignment is still valid. The DHCPREQUEST also serves as a binding acceptance notice to the selected server and an implicit decline to any other servers that may have provided the host a binding offer.
On receiving the DHCPREQUEST message, the server verifies the lease information, creates a new ARP entry for the client lease, and replies with a unicast 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 performs an ARP lookup for the assigned address. If it does not receive a reply, it knows that the IP address is valid and starts using it as its own.
DHCP Message Format
DHCP Discovery and Offer Methods
The DHCP messages work well, as shown in the figure, when the DHCP client and
server sit in the same subnet. Once the four messages are complete, the DHCP client
has an IP address, plus its other IPv4 settings, and it can send unicast IP packets as
normal.
Supporting DHCP for Remote Subnets with DHCP Relay
Network engineers have a major design choice to make with DHCP: Do they put a
DHCP server in every LAN subnet, or locate a DHCP server in a central site? With a
DHCP server in every subnet, is not scalable solution .
However, with a centralized DHCP server, many DHCP clients sit in a different
subnet than the DHCP server. So far in this section, it appears that the DHCP
message would never reach the DHCP server, because routers do not route
(forward) IPv4 packets sent to destination IP address 255.255.255.255. by default
router discard broadcast messages so DHCP relay work here
Many enterprise networks use a couple of DHCP servers at a centralized site, supporting
DHCP services to all remote subnets. The routers need to somehow forward those DHCP
messages between clients and the DHCP server. To make that work, the routers connected
to the remote LAN subnets need an interface subcommand: the ip helper-address server-ip
command.
The ip helper-address server-ip subcommand tells the router to do the following for the
messages coming in an interface, from a DHCP client:
1. Watch for incoming DHCP messages, with destination IP address 255.255.255.255.
2. Change that packet’s source IP address to the router’s incoming interface IP address.
3. Change that packet’s destination IP address to the address of the DHCP server (as
configured in the ip helper-address command).
4. Route the packet to the DHCP server.
Configuring a DHCP Server
The Cisco IOS DHCP server configuration steps are as follows:
Step 1. Exclude addresses from being assigned by DHCP: ip dhcp excluded-address first last
Step 2. Create a DHCP pool and go to pool configuration mode: ip dhcp pool name
A. Define subnet that the DHCP server should support: network subnet-ID mask or
network subnet-ID prefix-length
B. Define default router IP address(es) in that subnet: default-router address1 address2...
C. Define list of DNS server IP addresses: dns-server address1 address2...
D. Define length of lease, in days, hours, and minutes: lease days hours minutes
E. Define the DNS domain name: domain-name name
Router R1 has been configured with the following commands:
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 domain-name span.com
ip dhcp excluded-address 192.168.11.1 192.168.11.9 ip dhcp excluded-address 192.168.11.254 ip dhcp pool LAN-POOL-2 network 192.168.11.0 255.255.255.0 default-router 192.168.11.1 domain-name span.com
Verifying DHCP
DHCP relay configuration
The end