• Enable the DHCP function. DHCP what is it

    Hello, site visitor! We continue to study. In the ninth part, we will deal with the fact that how DHCP (Dynamic Host Configuration Protocol) works and why is it needed at all? This post will be about the purpose and capabilities of the DHCP protocol, as well as you and me Let's look at DHCP options and their purpose in the protocol. As always, we won’t rush anywhere; first we’ll look at DHCP in general terms, and then we’ll deal with the specifics.

    9.1.1 Introduction

    In the ICND1 and ICND2 courses, the DHCP protocol is discussed very superficially, and in general Cisco has spread information about this protocol into tracks in different directions and at different levels. We will look at DHCP in some detail and, perhaps, the information reviewed will be enough not only to answer questions on DHCP that may appear on the exam, but also to questions that may appear on the CCNP R&S exam.

    9.1.2 Why is DHCP needed and how is it related to IP?

    In the topic we talked about, we touched on the most basic points regarding DHCP and its purpose, now we will briefly recall what was discussed earlier. I think everyone knows very well that a tool such as a hammer is mainly used for driving nails, that is, we all understand why we need a hammer. So let's find out first - why do we need DHCP protocol.

    DHCP (Dynamic Host Configuration Protocol) or Dynamic Host Configuration Protocol needed to automate the setup process in . The DHCP protocol, with varying success, solves two global problems:

    1. Relieves the engineer from the same type and monotonous work of setting up gateways, DNS server addresses and other necessary parameters for. When performing such work, it is also easy to make mistakes, because there can be hundreds, or even thousands, of devices.
    2. The DHCP protocol to some extent, but not 100%, protects your network from such an unpleasant phenomenon as duplication of IP addresses. When manually configuring computer network nodes, you can have two approaches: either you keep records of issued IP addresses and write down the configurations of your nodes somewhere, or you let this matter take its course and issue IP addresses to your nodes, guided by the desires of your left heel . In small and very small networks, the second approach is applicable, but in large networks problems will arise even if you keep strict accounting, problems will arise precisely with accounting, each new IP address in your accounting system will make accounting more and more difficult . DHCP eliminates this manual accounting, because the DHCP server will remember the IP addresses that it issued, perhaps it will even remember to whom it issued this or that IP address, in order to then issue it again.

    In this topic, we will deal with the DHCP protocol in conjunction with, although it is worth noting that there is no point in considering DHCP without the IP protocol at all, the simple fact is that DHCPv6 has slightly different tasks, but that’s a completely different story. In general, the DHCP protocol, like many other protocols (for example, NAT), arose due to the shortcomings of IPv4, the fact is that IPv4 does not have a mechanism for automatically assigning IP addresses to interfaces, but IPv6 already has such a mechanism. That is DHCP extends the capabilities of IPv4 and makes the life of a network engineer easier and more enjoyable, though this engineer will have to study how this DHCP works.

    Also, you should not perceive DHCP as a protocol for issuing, you can issue not only IP addresses and masks, but also a huge variety of parameters, the parameters that the DHCP server can communicate to the client are called options, we will talk about them below, but I’ll note right away , that we will only deal with the mechanism of operation of the options, I will not be able to list all the options and, moreover, I don’t know them all, and I don’t really want to know them, to be honest.

    The DHCP protocol was standardized in 1993 and is the successor to the BOOTP protocol, we will see this when we get acquainted with the structure of messages in DHCP. By the way, the RARP protocol works on a similar principle to DHCP, but it is not at all interesting to us. DHCP is described in the RFC 2131 specification.

    9.1.3 DHCP server operating modes

    It is much more important to understand the operating modes of the DHCP server, so that it works the way you want, and not the way it turns out. This topic is not new to us, so I will be brief here.

    1. Manual assignment of static IP addresses.
    2. Automatic assignment of static addresses.
    3. Automatic distribution of dynamic addresses.

    The third operating mode of the DHCP server in the list is the most popular. In all three operating modes, the administrator must inform the server of the ranges or pools of IP addresses that it will issue to client equipment; each range of IP addresses must be from the same subnet, that is, there cannot be addresses from different subnets in the same range. Let's give a description of each of these modes.

    Manual mode of operation of the DHCP server. This mode of operation is not very different from the static configuration of client devices. The only difference is that the administrator does not run all over the network and makes all the settings on the DHCP server. In this mode, the server needs to set a strict mapping between IP addresses and MAC addresses. A device with one specific MAC address will always receive the same IP address; if there is no MAC address in the DHCP server database or an IP address is not set for the MAC address, then the client will not receive the settings.

    Automatic assignment of static addresses. The main feature of this mode is that the server issues an IP address to the client not for a certain time (in DHCP this time is called lease time), but forever. The DHCP server issues an IP address to the client without administrator intervention; the first time the client contacts, the server remembers it and then constantly issues the same IP address to this client.

    Automatic distribution of dynamic addresses mode. This is what we are most interested in, the most flexible and most versatile mode. In this mode, the server does not issue an IP address to the client forever, but for a strictly defined time, which is called the lease time, this time is assigned by the administrator, when the lease time expires, the client, if he wants, can extend it so as not to change the IP address. It is worth noting here that in this mode, addresses for clients can also be assigned to a specific client, for example, using option 82, but more on that later.

    The third mode has one very significant advantage, this advantage is the reuse of IP addresses, the client no longer needs an IP address, he reports this to the server, the server releases it, and then it can give this address to another client.

    9.1.4 DHCP protocol options and why are they needed? List of standard DHCP options

    You probably already realized that the DHCP protocol belongs to a group of protocols that operate on , DHCP belongs to the application layer of the and models, and DHCP messages in UDP are datagrams, but now we’re not talking about that. Now we need to understand what the request does to obtain parameters that are necessary so that the client can get full access to . these parameters are called DHCP options. To put it roughly, the client simply tells the server what options it needs, and the server, based on some of its criteria, can decide what options and with what values ​​should be issued to the client, or maybe they should not be issued to this client at all.

    At the same time, it is worth noting that DHCP options may or may not be standard and here is the first stumbling block. Not all DHCP server implementations, just like not all software implementations of DHCP clients, support the entire list of standard options; some DHCP implementations have their own non-standard options that are not supported by other implementations, and all this can bring chaos to the orderly world of DHCP. The fact is that the client can receive an option, and the server, accordingly, can issue it, only if both the client and the server understand this option and know how to work with it, which, in fact, is logical.

    An obvious problem that you may have: to connect a client device to a computer network, you need an option that this device cannot work with, but the manufacturers haven’t added support for this option and that’s it. The list of standard DHCP options is described in RFC 2132. Moreover, each standard option has its own RFC, which describes why this option is needed and how it should work.

    E If we talk about the most commonly used DHCP options, then here is a small list for you now and at the end there will be more:

    • Default gateway IP address;
    • subnet mask;
    • DNS server addresses;
    • DNS domain name.

    To transfer options between the client and server, the DHCP packet has a special variable length field, which is called options. This field has a variable length, but all other fields of the DHCP message are fixed. If we consider that both the DHCP client and the DHCP server must be able to process a packet of 576 bytes in size (576 bytes was taken not out of the blue, but from the limitations of some older protocols), and also know the size of other fields in the packet, then it will not be difficult to calculate that the options field has a minimum length of 340 bytes. In this case, the options field itself begins with a fixed Magic Cookie sequence, which looks like this: 0x63825363. You can say it another way, Magic Cookie is four bytes with the values ​​99, 130, 83, 99. Whatever you call it, but by this sequence the device understands that the fixed part of the packet has ended and DHCP options have begun.

    By the way, there are two more optional fields in the DHCP packet, that is, there is space in the packet instead of which options can be sent - these are the file (64 bytes) and snmae (128 bytes) fields. What else can you add about DHCP options? Each standard option has a unique number from 0 to 255; or rather, it would be more correct to say the code rather than the number. Each option has a size, while some options do not have a strictly fixed size, but some boundaries within which the option can float. You will have to look for more detailed information about DHCP options in special RFCs, the thing is that some options must start, for example, from scratch, some options cannot be used together, there are a number of other features that it makes no sense for us to delve into now.

    All that remains is to say that The options field in a DHCP packet must always end with option code 255, with this option the devices understand that this is the end, there will be no more options, and the DHCP packet itself is over.

    9.1.6 List of the most frequently used DHCP options

    Below you will find a table that lists the most commonly used options in DHCP, the likelihood of encountering them is very high and I would recommend that you familiarize yourself with them in more detail in the relevant RFCs.

    Code Name Length Option Description
    1 Subnet Mask 4 Subnet mask
    3 Router x4 List available routers. Or simply put, the IP addresses of available default gateways; there may be several of them on the network.
    6 Name Server x4 Listing available DNS servers
    12 Host Name 1+ Symbolic node name
    23 Default IP TTL 1 Allows you to set the TTL that the client will be required to use when sending packets to the network. Using this option, you can restrict user access to the Internet.
    26 Interface MTU 2 If you need all nodes to use the same MTU, then here is an option.
    33 Static IP Route x8 You remember that once upon a time networks were classful, initially this field was for issuing routes to nodes in classful networks, so there was no place for a mask here. Now, in the era of VLSM and CIDR, using this option you can issue static routes to hosts to remote networks with a /32 mask.
    35 ARP Cache Timeout 4 The ARP protocol has a cache, each operating system stores the ARP cache for a different amount of time, to bring order to this chaos there is a DHCP option 35 that forces all hosts to store ARP entries for the same amount of time.
    50 Requested IP Address 4 This option is used by the client to tell the server what IP address it wants to receive.
    55 Parameter Request List 1+ With this option, the DHCP client tells the server a list of options that it wants to receive.
    61 Client Identifier 2+ The DHCP server matches IP and MAC addresses, it remembers which MAC address was assigned to which IP. But instead of MAC addresses, you can use a client ID.
    66 TFTP Server Name 1+ The name of the option speaks for itself.
    82 I don't know what this option is called, and I'm too lazy to look at the RFC. All the engineers around me just say option eighty-two. We will get acquainted with this option separately; a brief description will not get you off here.
    121 Classless Route 5+ This option can provide default routes in classless networks.
    150 TFTP Server IP Address 4 Here, too, everything is clear from the name.
    255 End 0 If there are options in the packet, then this option is mandatory, it means that there will be no other options and this is the end of the DHCP packet.

    9.1.7 Conclusions

    It was familiarity with the DHCP protocol and its main features, you probably noticed that all the most important information in DHCP is transmitted in the form of options, the options field is a fairly flexible tool for dynamically configuring hosts.

    What is DHCP?

    When researching Internet terminology, you may come across the acronym DHCP. Let's look at what it is and what functions DHCP performs on the Internet. This abbreviation stands for Dynamic Host Configuration Protocol - a protocol for dynamic host configuration. DHCP is a network protocol through which a computer receives information about IP addresses and other data automatically.

    The standard for this protocol was adopted in 1993. The current version is the March 1997 version, which is described in REC 2131. The new version used in IPv6 is called DHCPy6 - it was created in July 2003 and defined in REC 3315.

    How does DHCP work?

    The DHCP protocol operates according to the client-server scheme. Here, the network load or tasks are distributed between providers - servers - and customers - clients. The server and client are software, they communicate with each other through a computer network using UDP protocols.

    IP addresses are distributed in three ways:

    • Manual. The administrator maps a specific IP address to the hardware address of an individual client computer. Address information is stored on a central server, so it can be easily changed if necessary.
    • Auto. IP addresses are distributed randomly between computers.
    • Dynamic. It works in the same way as an automatic one, but the address is issued for a specific period of use. After the deadline expires, the address becomes free again, the client needs to request a new one.

    DHCP Options

    In addition to the IP address, DHCP can represent other additional parameters needed for operation - DHCP options. Among them are, for example, a subnet mask, a router's IP address, a DNS server address, and a domain name.

    DHCP Implementation

    Microsoft first launched a DHCP server on Windows NT 3.5 in 1994. With Windows 2000 Server, the server can update DNS records dynamically.

    On December 6, 1997, the Internet Systems Consortium released ISC DHCP Server. In June 1999, version 2.0 was released, close to the standard.

    At the moment, there are different implementations of this server for Windows as separate programs that perform DHCP functions.

    You can find out the meanings of other unknown Internet terms from the articles in the section.


    DHCP contains an encrypted name - Dynamic Host Configuration Protocol, and this is exactly what it does. Its role in the connection is key; through data exchange, the client receives unique parameters, then they are applied and used as a bridge. It is used in most TCP/IP networks and equalizes the load on channels, regulating client access.

    We are not even aware of how the connection to the network is made and we have absolutely no participation in it. Having delved a little deeper into the topic, we will understand that configuration is a necessary element of connection, critical for functioning. Here the DHCP server does all the work; it sends requests from the client, generating them, then processing them on the server and sending a response. This is a common connection scheme; providers actively use it. If you remove the server, you will be faced with manually setting up access, and this is very difficult to do.

    In many systems, the Internet disappears, even though it is physically accessible. By clicking on “Network Diagnostics”, the computer manages to correct the situation and is written that the “No available IP addresses” problem has been resolved. This is a prime example where DHCP configuration is applied by sending and decrypting a parameter request.

    Installing DHCP is of interest to users because of the need to deploy an office/home network, thus protecting yourself from repetition of parameters, channel congestion and network failures. The simplest representative that allows you to enable a DHCP server without additional waste of time and is easy to use is a Wi-Fi router. It can perform all the required functions of dynamic address distribution and restrictions.

    How to enable DHCP on Windows?

    The standard settings should contain the active state of DHCP, because the technology has become a standard. There are exceptional cases when the provider replaces the protocol in favor of a static IP, which requires manual configuration. It is worth considering the situation when it is still disabled, then you will have to enable DHCP Windows, and this is easy to do:

    • Start and go to “Control Panel”;
    • Now click on the “Administration” tile;

    • LMC on “Services”;
    • Find the element called “DHCP client” and double-click;

    • Set "Automatic" launch and apply.

    Specifying Dynamic Parameters

    This is the first option that will help us enable support for receiving DHCP, but it is not the only one and one method can be supplemented with another. Next, you need to configure the network itself so that it understands where to receive connection parameters from:

    • Start and select “Control Panel”;
    • Now find “Network and Sharing Center”; the standard panel view should be used;
    • Click on the link “Change adapter settings”;

    • RMB on the element and click “Properties”;
    • Double click on TCP/IPv4 and check the boxes next to Obtain DNS/IP address automatically;

    • Then go back and click "Customize";
    • On the “Power Management” tab, uncheck all the boxes and save.

    Now DHCP Windows 10 or any other version works correctly, receiving all parameters automatically, which eliminates various network problems. Also, if you are interested in how to disable DHCP, then you need to follow the steps exactly as in the instructions, just replace the parameters with the ones you need, namely: in the client startup type you need to set “Manual” or “Disabled”, and in the parameters specify static DNS and IP addresses. It is better to indicate alternate addresses, if they exist, so that if there is no response, you can contact another.

    Setting up a DHCP server in the router

    When you use several gadgets/PCs, there is no need to deploy home DHCP, because it is better to use a Wi-Fi router or do without it altogether. In most cases, the main DHCP server is located on the provider's side, so you only need to enable the technology, and the system is responsible for its correct processing. The data transmitted by the server is standardized, so all operating systems support it and can interact with it correctly.

    If you have a certain range of dedicated IP addresses and you use more than 2 components for connection, then it makes sense to think about installing a server using a Wi-Fi router. To go to the DHCP interface of the router you need to:

    • Go to 192.168.0.1 (sometimes a different one is used) in the browser;
    • Enter the password, standard admin – admin, you can find it in the documentation;
    • Now you can see a special DHCP section, sometimes it is not placed separately, but is located in the Network or LAN section;

    • Select the "DHCP Server" option and enable it;
    • Specify the range of addresses used and assigned and the lease time.

    After completing the procedure, you will be able to access your server from any device, thanks to which it will automatically be assigned a subnet mask, IP address, DNS and all other parameters. In this way, you can limit the number of devices connected to the router, since a separate address will be allocated for each.

    We have analyzed the simplest DHCP client-server model, which contains key operating features and an algorithm for performing dynamic updates, maintaining current parameters.

    If you still have questions on the topic “What is DHCP and what is it used for?”, you can ask them in the comments


    if(function_exists("the_ratings")) ( the_ratings(); ) ?>

    Hi all! Today we will devote an article to a story about the protocol DHCP (Dynamic Host Configuration Protocol)– what it is, why it is needed and how it works. DHCP is available for both IPv4 (DHCPv4), and for IPv6 (DHCPv6). In this article we will look at the IPv4 version. And in the next article we will tell you about setting it up.

    Every device connected to a network needs a unique IP address. Network administrators assign static IP addresses to routers, servers, printers, and other network devices whose locations (physical and logical) are unlikely to change. These are typically devices that provide services to users and devices on a network, so the addresses assigned to them must remain constant. Additionally, static addresses allow administrators to manage these devices remotely—it's easier to access a device when they can easily determine its IP address.

    However, computers and users in an organization often change locations, physically and logically. It can be difficult and time-consuming to assign new IP addresses every time an employee moves. And for mobile workers working from remote locations, manually configuring the correct network settings can be a daunting task.

    Using DHCP on your local network simplifies the assignment of IP addresses on both desktop and mobile devices. Using a centralized DHCP server allows you to administer all dynamic IP address assignments from a single server. This practice makes IP address management more efficient and ensures consistency across the organization, including branches.

    DHCPv4 dynamically assigns IPv4 addresses and other network configuration information. A standalone DHCPv4 server is scalable and relatively easy to manage. However, in a small office, the router can be configured to provide DHCP services without the need for a dedicated server.

    DHCPv4 includes three different address allocation mechanisms to provide flexibility in IP address assignment:

    • Manual Allocation- The administrator assigns a preset IPv4 address to the client, and the DHCP server transfers the IPv4 address to the device.
    • Automatic Allocation- DHCPv4 automatically assigns a static IPv4 address to the device, choosing it from a pool of available addresses. No rent ( lease), and the address is permanently assigned to the device.
    • Dynamic Allocation- DHCPv4 dynamically assigns or leases an IPv4 address from a pool of addresses for a limited period of time chosen by the server or until the client no longer needs the address.

    Dynamic allocation is the most commonly used DHCP mechanism, and when used, clients lease information from a server for a specified period. DHCP servers are configured to establish leases at various intervals. Rentals typically range from 24 hours to a week or more. When the lease expires, the client must request a different address, although they usually receive the old one again.

    How DHCP works

    DHCPv4 operates in client/server mode. When a client communicates with a DHCPv4 server, the server assigns or leases an IPv4 address to that client. It connects to the network with this leased IP address until the lease expires and must periodically contact the DHCP server to renew the lease. This lease mechanism ensures that clients that move or fail do not retain addresses that they no longer need. When the lease expires, the DHCP server returns the address to the pool, where it can be redistributed as needed.

    Let's look at the process of obtaining an address:

    1. When a client boots up (or wants to join the network), it begins a four-step process to obtain a lease. It starts a process with a broadcast ( broadcast) message DHCPDISCOVER with its own MAC address to discover available DHCPv4 servers. Since the client has no way of knowing the subnet it belongs to, the message DHCPDISCOVER IPv4 address destination address - 255.255.255.255 . And since the client does not yet have an IPv4 address configured, the source IPv4 address is 0.0.0.0 .
    2. Message DHCPDISCOVER finds DHCPv4 servers on the network. Since the client does not have IPv4 information at boot, it uses Layer 2 and Layer 3 broadcast addresses to communicate with the server.
    3. When the DHCPv4 server receives the message DHCPDISCOVER, it reserves an available IPv4 address for lease to the client. The server also creates an ARP entry consisting of the client's MAC address and the leased IPv4 address. The DHCP server sends the associated message DHCPOFFER to the requesting client as a unicast transmission ( unicast), using the server's MAC address as the source address and the client's MAC address as the delivery address.
    4. When the client receives DHCPOFFER from the server, it sends back a message DHCPREQUEST. This message is used to both obtain and renew leases. When used to obtain a lease, DHCPREQUEST serves as a notification that the server has accepted the options it has proposed and rejected suggestions from other servers. Many corporate networks use multiple DHCP servers, and the message DHCPREQUEST sent as a broadcast to inform all servers that the offer has been accepted.
    5. When you receive a message DHCPREQUEST the server checks the lease information with an ICMP request to this address to ensure that it is no longer in use and creates a new one ARP entry for the client lease and then responds with a unicast DHCPACK message. This post is a duplicate DHCPOFFER, except for changing the message type field. When the client receives the message DHCPACK, it logs information and performs an ARP lookup for the assigned address. If there is no response to the ARP, the client knows that the IPv4 address is valid and starts using it as its own.

    Now let’s look at how an address lease is renewed:

    1. When the lease has expired, the client sends a message DHCPREQUEST directly to the DHCP server that originally offered the address. If DHCPACK not received within a certain period of time, then the client sends another DHCPREQUEST so that one of the other available DHCPv4 servers can renew the lease.
    2. When you receive a message DHCPREQUEST the server checks the rental information, returning DHCPACK

    Was this article useful to you?

    Please tell me why?

    We are sorry that the article was not useful for you: (Please, if it is not difficult, indicate why? We will be very grateful for a detailed answer. Thank you for helping us become better!

    Each host connected to a TCP/IP-based network must be assigned a unique IP address. DHCP (Dynamic Host Configuration Protocol) was developed as a means of dynamically assigning IP addresses to hosts. DHCP is an open industry standard that simplifies the management of TCP/IP-based networks. This protocol can be used to centrally manage the process of configuring the TCP/IP protocol stack on client machines (we are talking about parameters such as the default gateway address or DNS server address).
    The DHCP protocol specification defines two participants: the DHCP server and the DHCP clients. The DHCP Client service requests parameters from the DHCP server to configure the TCP/IP protocol stack. The DHCP server service processes client requests by leasing an IP address from a certain range. Each address is allocated for a specific period. At the end of this period, the host must either renew the lease or release the address. All satisfied user requests are recorded by the DHCP server service in its own database. This solution prevents the allocation of one IP address to two hosts. At the same time as issuing an IP address, the DHCP server can also provide the client with additional information about the TCP/IP protocol stack settings, such as the subnet mask, gateway address, and DNS and WINS server addresses.

    It seems quite clear that support for this protocol was implemented in the Windows Server 2003 operating system. Windows Server 2003 includes both a DHCP client (which is installed by default) and a DHCP server (which can be installed and configured by the administrator if necessary) . Windows 2000 Server support for DHCP has the following characteristics:

    • DNS integration. DNS servers provide name resolution for network resources and are closely related to the DHCP service. DHCP servers and DHCP clients can dynamically register issued IP addresses and associated domain names in the DNS server database. In this case, resource records of the PTR (pointer) and A (address) types are created in the DNS server database.
    • Improved management and monitoring. The new feature provides notification of IP pool usage levels. Notification is made using the corresponding icon or by sending a message. The DHCP server supports SNMP and MIB, which provides graphical representation of statistical data. This helps the administrator monitor the network status, such as the number of available and occupied addresses, the number of leases processed per second, etc.
    • Group address distribution. A DHCP server can be used to allocate multicast addresses to clients. Recently, a large number of corporate applications have appeared that require the use of group addresses (for example, video or audio conferencing).
    • Protection against server spoofing. One of the prerequisites for the functioning of a DHCP server is the requirement for its authorization in the Active Directory. Each time the DHCP Server service starts, it tries to locate a directory entry that confirms the service's authorization. If such an entry is not found, the server service does not start.
    • Automatic client configuration. If there is no DHCP server on the network, the DHCP client service can perform the necessary configuration independently. Using a temporary configuration of the TCP/IP protocol stack to operate, the client continues to attempt to contact the DHCP server in the background every 5 minutes. At the same time, automatic address assignment is always transparent to users. Addresses for these types of clients are selected from a range of private TCP/IP network addresses that are not used on the Internet.
    • New specialized options and support for option classes. The administrator can create custom DHCP classes (used for client configuration) as required. The custom class mechanism allows DHCP to be used in custom applications for enterprise networks. Vendor classes can be used to configure various network hardware features.

    Also noteworthy is functionality that was first added to the DHCP service implementation in Windows Server 2003.

    • Ability to backup the DHCP database. The DHCP server database stores information about the IP addresses issued to clients, including information about the lease expiration time. Registering this information avoids re-allocating addresses that have already been issued. Damage to this database could result in the network's functionality being compromised. The administrator can back up the DHCP server database. The created backup copy can be used later to restore the functionality of the DHCP server.
    • Ability to set an alternative DHCP client configuration. The DHCP client can be configured with an alternate TCP/IP configuration, allowing the computer to be moved between different subnets.