what is dhcp

10
What Is DHCP? Dynamic Host Configuration Protocol In simple terms, DHCP determines if your IP is static or dynamic and the length of time an IP address is assigned. Dynamic Host Configuration Protocol is controlled by a DHCP server. Your router can be a DHCP server…and if you’re on a home network, it most likely serves this purpose. I know this might be confusing because the word dynamic is in the term, but just because you have DHCP enabled on your computer doesn’t mean you can’t be assigned a static IP. DHCP enabled on your computer simply means you’re letting a DHCP server assign its IP. Having it enabled DOES NOT mean it’s a DHCP server. A true DHCP server (not your Linksys router) gives the LAN Admin a ton of control with IP assigning. Ever print to a network printer? Ever wonder how that printer keeps its network assignment? Each network device has a MAC address. You can assign a static IP at the server to a specific MAC address. This allows the network printer to always get the same IP even after it reboots and without assigning the IP at the printer. If you print the network configuration at the printer, it will probably tell you that DHCP is enabled and no static IP is assigned. That’s because the IP assignment is handled at the server. Your ISP has a DHCP server. They can assign IPs by modem MAC addresses. When your modem comes online, it communicates to the network indicating it is looking for an IP address. The DHCP server listens to this communication and starts talking to the modem. The modem then transmits its MAC address to the DHCP server. At that point, either an IP has been reserved for the modem or one is assigned at that time.

Upload: teenujoseph

Post on 25-Dec-2015

7 views

Category:

Documents


0 download

DESCRIPTION

dhcp

TRANSCRIPT

Page 1: What is Dhcp

What Is DHCP?

Dynamic Host Configuration Protocol

In simple terms, DHCP determines if your IP is static or dynamic and the length of time

an IP address is assigned.

Dynamic Host Configuration Protocol is controlled by a DHCP server. Your router can

be a DHCP server…and if you’re on a home network, it most likely serves this purpose.

I know this might be confusing because the word dynamic is in the term, but just because

you have DHCP enabled on your computer doesn’t mean you can’t be assigned a static

IP. DHCP enabled on your computer simply means you’re letting a DHCP server assign

its IP. Having it enabled DOES NOT mean it’s a DHCP server.

A true DHCP server (not your Linksys router) gives the LAN Admin a ton of control

with IP assigning.

Ever print to a network printer? Ever wonder how that printer keeps its network

assignment? Each network device has a MAC address. You can assign a static IP at the

server to a specific MAC address. This allows the network printer to always get the same

IP even after it reboots and without assigning the IP at the printer. If you print the

network configuration at the printer, it will probably tell you that DHCP is enabled and

no static IP is assigned. That’s because the IP assignment is handled at the server.

Your ISP has a DHCP server. They can assign IPs by modem MAC addresses. When

your modem comes online, it communicates to the network indicating it is looking for an

IP address. The DHCP server listens to this communication and starts talking to the

modem. The modem then transmits its MAC address to the DHCP server. At that point,

either an IP has been reserved for the modem or one is assigned at that time. Hence

cloning your MAC address to get a new IP from your ISP.

Routers and DHCP – Under the General Setup or LAN Setup tab in your router, you’ll

see a settings option for DHCP. You can control how many IPs are assigned or to

enable/disable the DHCP server portion of the router. If you disable it, you’ll have to

statically assign IPs to each computer, or have a DHCP server or your network. This goes

for wired and wireless. Any connection on your network has an IP address.

Page 2: What is Dhcp

What is DHCP?

The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to assign IP addresses and provide configuration information to devices such as servers, desktops, or mobile devices, so they can communicate on a network using the Internet Protocol (IP). ISC DHCP is a collection of software that implements all aspects of the DHCP (Dynamic Host Configuration Protocol) suite. It includes:

A DHCP server, which receives clients’ requests and replies to them.

A DHCP client, which can be bundled with the operating system of a client computer or other IP capable device and which sends configuration requests to the server. Most devices and operating systems already have DHCP clients included.

A DHCP relay agent, which passes DHCP requests from one LAN to another so that there need not be a DHCP server on every LAN.

The DHCP server, client and relay agent are provided both as reference implementations of the protocol and as working, fully-featured sample implementations. Both the client and the server provide functionality that, while not strictly required by the protocol, is very useful in practice. The DHCP server also makes allowances for non-compliant clients that need to be supported. The ISC DHCP server will answer requests from any client that complies with the protocol standards, and the ISC DHCP client can interact with any server that complies with those standards. The components of ISC DHCP need not all be used together. That is, after all, the purpose behind the published standards. The latest ISC DHCP software includes cryptographic software written by Eric Young ([email protected]) of OpenSSL

History of DHCP

DHCP was first defined as a standards track protocol in RFC 1531 in October 1993, as an extension to the Bootstrap Protocol (BOOTP), a network protocol used by a network client to obtain an IP address from a configuration server. The motivation for extending BOOTP was that BOOTP required manual intervention to add configuration information for each client, and did not provide a mechanism for reclaiming disused IP addresses. Many worked to clarify the protocol as it gained popularity, and in 1997 RFC 2131 was released, and remains as of 2013 the standard for IPv4 networks. To support IPv6 protocol,  DHCPv6 was introduced and documented in RFC 3315. DHCPv6 is an extensible protocol. Currently there are over 80 options defined, with many more undergoing standardization process. RFC 3633 added a DHCPv6 mechanism for prefix delegation. DHCPv6 was further extended to provide configuration information to clients configured using stateless address auto configuration in RFC 3736. To see a list of

Page 3: What is Dhcp

approved options and message types, please visit here. The ISC DHCP server was originally written for Internet Systems Consortium by Ted Lemon and Vixie Enterprises, and maintained it through Release 3.0, which had its alpha release in March 1999 and its final release in January 2003. Since 2004, a dedicated ISC engineering team has been maintaining and developing the ISC DHCP, including IPv6 support and failover support.

29.6. Dynamic Host Configuration Protocol (DHCP)

The Dynamic Host Configuration Protocol (DHCP) allows a system to connect to a network in order to be assigned the necessary addressing information for communication on that network. FreeBSD includes the OpenBSD version of dhclient which is used by the client to obtain the addressing information. FreeBSD does not install a DHCP server, but several servers are available in the FreeBSD Ports Collection. The DHCP protocol is fully described in RFC 2131. Informational resources are also available at isc.org/downloads/dhcp/.

29.6.1. Configuring a DHCP Client

DHCP client support is included in the FreeBSD installer, making it easy to configure a newly installed system to automatically receive its networking addressing information from an existing DHCP server.

When dhclient is executed on the client machine, it begins broadcasting requests for configuration information. By default, these requests use UDP port 68. The server replies on UDP port 67, giving the client an IP address and other relevant network information such as a subnet mask, default gateway, and DNS server addresses. This information is in the form of a DHCP “lease” and is valid for a configurable time. This allows stale IP addresses for clients no longer connected to the network to automatically be reused. DHCP clients can obtain a great deal of information from the server.

By default, when a FreeBSD system boots, its DHCP client runs in the background, or asynchronously. Other startup scripts continue to run while the DHCP process completes, which speeds up system startup.

Background DHCP works well when the DHCP server responds quickly to the client's requests. However, DHCP may take a long time to complete on some systems. If network services attempt to run before DHCP has assigned the network addressing information, they will fail. Using DHCP in synchronous mode prevents this problem as it pauses startup until the DHCP configuration has completed.

To instead configure the system to use synchronous mode, and to pause during startup while DHCP completes, use “SYNCDHCP”:

ifconfig_fxp0="SYNCDHCP"

Page 4: What is Dhcp

The DHCP client uses the following files:

/etc/dhclient.conf

The configuration file used by dhclient. Typically, this file contains only comments as the defaults are suitable for most clients.

/sbin/dhclient

/sbin/dhclient-script

The FreeBSD-specific DHCP client configuration script. It is described in dhclient-script ( , but should not need any user modification to function properly.

/var/db/dhclient.leases.interface

The DHCP client keeps a database of valid leases in this file, which is written as a log and is described in dhclient.leases (

What is DHCP?Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. RFCs 2131 and 2132 define DHCP as an Internet Engineering Task Force (IETF) standard based on Bootstrap Protocol (BOOTP), a protocol with which DHCP shares many implementation details. DHCP allows hosts to obtain necessary TCP/IP configuration information from a DHCP server.

The Microsoft Windows Server 2003 operating system includes a DHCP Server service, which is an optional networking component. All Windows-based clients include the DHCP client as part of TCP/IP, including Windows Server 2003, Microsoft Windows XP, Windows 2000, Windows NT 4.0, Windows Millennium Edition (Windows Me), and Windows 98.

Benefits of DHCPIn Windows Server 2003, the DHCP Server service provides the following benefits:

Reliable IP address configuration. DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time.

Reduced network administration. DHCP includes the following features to reduce network administration: 

Centralized and automated TCP/IP configuration.

The ability to define TCP/IP configurations from a central location.

The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options.

Page 5: What is Dhcp

The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to different locations on a wireless network. 

The forwarding of initial DHCP messages by using a DHCP relay agent, thus eliminating the need to have a DHCP server on every subnet.

Why use DHCPEvery device on a TCP/IP-based network must have a unique unicast IP address to access the network and its resources. Without DHCP, IP addresses must be configured manually for new computers or computers that are moved from one subnet to another, and manually reclaimed for computers that are removed from the network.DHCP enables this entire process to be automated and managed centrally. The DHCP server maintains a pool of IP addresses and leases an address to any DHCP-enabled client when it starts up on the network. Because the IP addresses are dynamic (leased) rather than static (permanently assigned), addresses no longer in use are automatically returned to the pool for reallocation.The network administrator establishes DHCP servers that maintain TCP/IP configuration information and provide address configuration to DHCP-enabled clients in the form of a lease offer. The DHCP server stores the configuration information in a database, which includes:

Valid TCP/IP configuration parameters for all clients on the network.

Valid IP addresses, maintained in a pool for assignment to clients, as well as excluded addresses.

Reserved IP addresses associated with particular DHCP clients. This allows consistent assignment of a single IP address to a single DHCP client.

The lease duration, or the length of time for which the IP address can be used before a lease renewal is required.

A DHCP-enabled client, upon accepting a lease offer, receives:

A valid IP address for the subnet to which it is connecting.

Requested DHCP options, which are additional parameters that a DHCP server is configured to assign to clients. Some examples of DHCP options are Router (default gateway), DNS Servers, and DNS Domain Name. For a full list of DHCP options, see “DHCP Tools and Settings.”

The Dynamic Host Configuration Protocol (DHCP) is a standardized networking protocol used on Internet Protocol (IP) networks for dynamically distributing network configuration parameters, such as IP addresses for interfaces and services. With DHCP, computers request IP addresses and networking parameters automatically from a DHCP

Page 6: What is Dhcp

server, reducing the need for a network administrator or a user to configure these settings manually.

Overview[edit]

Dynamic Host Configuration Protocol is used by computers for requesting Internet Protocol parameters, such as an IP address from a network server. The protocol operates based on the client-server model. DHCP is very common in all modern networks[1] ranging in size from home networks to large campus networks and regional Internet service provider networks. Most residential network routers receive a globally unique IP address within the provider network. Within a local network, DHCP assigns a local IP address to devices connected to the local network.

When a computer or other networked device connects to a network, its DHCP client software in the operating system sends a broadcast query requesting necessary information. Any DHCP server on the network may service the request. The DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway, domain name, the name servers, and time servers. On receiving a request, the server may respond with specific information for each client, as previously configured by an administrator, or with a specific address and any other information valid for the entire network, and the time period for which the allocation (lease) is valid. A host typically queries for this information immediately after booting, and periodically thereafter before the expiration of the information. When an assignment is refreshed by the client computer, it initially requests the same parameter values, but may be assigned a new address from the server, based on the assignment policies set by administrators.

On large networks that consist of multiple links, a single DHCP server may service the entire network when aided by DHCP relay agents located on the interconnecting routers. Such agents relay messages between DHCP clients and DHCP servers located on different subnets.

Depending on implementation, the DHCP server may have three methods of allocating IP-addresses:

dynamic allocation: A network administrator reserves a range of IP addresses for DHCP, and each client computer on the LAN is configured to request an IP address from the DHCP serverduring network initialization. The request-and-grant process uses a lease concept with a controllable time period, allowing the DHCP server to reclaim (and then reallocate) IP addresses that are not renewed.

automatic allocation: The DHCP server permanently assigns an IP address to a requesting client from the range defined by the administrator. This is like dynamic allocation, but the DHCP server keeps a table of past IP address assignments, so that it can preferentially assign to a client the same IP address that the client previously had.

static allocation: The DHCP server allocates an IP address based on a preconfigured mapping to each client's MAC address. This feature is variously called static DHCP assignment by DD-WRT, fixed-address by the dhcpd documentation, address reservation by Netgear, DHCP reservation or static

Page 7: What is Dhcp

DHCP by Cisco and Linksys, and IP address reservation or MAC/IP address binding by various other router manufacturers.

DHCP is used for Internet Protocol version 4 (IPv4), as well as IPv6. While both versions serve the same purpose, the details of the protocol for IPv4 and IPv6 are sufficiently different that they may be considered separate protocols.[2] For IPv6 operation, devices may alternatively use stateless address autoconfiguration. IPv4 hosts may also use link-local addressing to achieve operation restricted to the local network link.

History[edit]

DHCP was first defined as a standards track protocol in RFC 1531 in October 1993, as an extension to the Bootstrap Protocol (BOOTP). The motivation for extending BOOTP was that BOOTP required manual intervention to add configuration information for each client, and did not provide a mechanism for reclaiming unused IP addresses.

Security

The base DHCP protocol does not include any mechanism for authentication.[10] Because of this, it is vulnerable to a variety of attacks. These attacks fall into three main categories:

Unauthorized DHCP servers providing false information to clients.[11]

Unauthorized clients gaining access to resources.[11]

Resource exhaustion attacks from malicious DHCP clients.[11]