It is well known that to work with the network, each device, be it a computer, laptop, tablet or phone, must have a certain electronic identifier - an IP address, as well as configured mask, gateway and DNS server data. When connected, the network interface immediately tries to get this address from special equipment that deals with automatic distribution of addresses. If such equipment is not found, then the user has to enter the network parameters manually. If there are many computers on the network, then addressing errors and duplicate addresses are possible, leading to system failures and slowing down the performance of the network as a whole. In a home network, in the absence of automatic distribution of addresses, you have to manually set the network parameters on each device to connect, for example, to a router. Not every user has enough knowledge and experience to properly change suchsettings. Therefore, at home, too, many users are trying to deploy automatic distribution of addresses, that is, deploy a DHCP server.

DHCP - what is it?
Let's look into this matter. The Dynamic Host Configuration Protocol (DHCP) has been implemented to avoid addressing errors. This is a function that dynamically distributes network settings to connected client machines. If these devices are configured with the option “Obtain an IP address only from a DHCP server” and the DHCP service is enabled, then all responsibility for the correct configuration of network parameters on client computers is transferred to the DHCP server. This greatly reduces the cost of maintaining and managing the network, and also helps to avoid errors in the distribution of addresses. A service that includes DHCP starts automatically by default when you turn on any device that supports wired or wireless network interfaces. For example, on tablets or phones, it is enough to turn on Wi-Fi and among the found devices distributing the Internet, find your own and connect to it. At the same time, automatic distribution of addresses eliminates IP duplication and, as a result, helps to avoid network conflicts.

How addresses are distributed
When any client device connects to the network, a special broadcast request is sent to the network in order to find the DHCP server distributing the parameters of this network. What kind of server is this and why is it important for a large network? This is the name of a device thatis responsible for handing out addresses to computers on the network so that they can be automatically applied to different clients. If such a server is present, then it creates a packet with a response to the client request, which may include settings such as IP address, netmask, gateway settings, DNS server addresses, domain name, etc. and sends this packet to the client device. The client receives an acknowledgment signal from the DHCP server. The generated data packet is standardized, so it can be decrypted and used by almost any operating system.
Parameters issued by the server for the client device have a limited configurable validity period, which has its own name - "lease time". Addresses issued by the server are parsed to match valid addresses with unexpired lease times, so address duplication is eliminated. Usually the rental period is short - from several hours to 4-6 days. After this period, the device repeats the request to the server and receives from it the same address (if it is still free) or any free one.

Client settings for receiving automatic network settings in Windows
In order for the client to receive response network parameters from DHCP, you need to check several settings in the Computer Control Panel (considered using the Windows operating system as an example). To do this, go to the Start menu, then to the Control Panel (which you need to switch to the classic view) and select the "Network Connections" item. Choose a networkconnection that is planned to work with DHCP, right-click on it and go to the "Properties" item. In the window that opens, go to the Properties of the Internet Protocol TCP / IP. DHCP - what is it? This is getting automatic network settings. Therefore, we dot the options for automatically obtaining an IP address and DNS. Having made a choice, click "OK". DHCP configuration on the client is complete. Now the device will receive an address from the DHCP server automatically when Windows starts.
The DHCP setting in Windows 7 is set up similarly, but the location of adapter properties is slightly different from Windows XP. We also go to Start - Control Panel - Network and Sharing Center. Select "Change adapter settings" from the left menu. Further - similar to the above for the settings in Windows XP.
Setting up automatic distribution of addresses in other operating systems
On Linux or Android devices, connecting with a DHCP server deployed on the network is no problem. You just need to turn on the network interface (wired or wireless), wait for the communication between the device and the DHCP server to pass, and make sure that the network settings are received and applied successfully. DHCP services are enabled by default on almost all devices.
If there is no connection, then you need to check the status of automatic acceptance of addresses. For example, on Android OS, for this you need to go to Settings - Wireless networks - Wi-Fi settings - Advanced and make sure that the option "use static IP-address" disabled.
Data transmitted by DHCP
DHCP options are parameters that are passed from the server to the client. All these passed parameters are divided into categories. There are mandatory options, such as IP address and netmask. There are non-configurable service options, which, for example, show the beginning and end of the options in the transmitted packet. At their core, options are typical value-key pairs that can be seen and configured in security policies.
The main DHCP parameters in the packet, except for the IP address and mask, are 3 (Gateways), 6 (Domain Name Servers), 44 (NBT Name Servers), 46 (NBT Node Type). These parameters are group parameters, that is, they can have several values. For example, there may be multiple gateway or DNS server addresses. The option values are configured in the DHCP server settings.

DHCP settings on the server
Before configuring the settings, you need to make some calculations of basic DHCP options. What are these other options? - you ask. Options are all those network parameters that are passed from the server to the client. The two main options are the range of distributed addresses and the subnet mask. The entire address range of an organization is usually divided into several segments designed for various tasks, such as telecommunications, static server addresses, etc. To prevent static addresses from being distributed, creating additional load on the server, the ranges of distributed addresses can be limited. For example, with an operating range of 192.168.1.1-192.168.1.254, addresses from 1 to 10 can be defined oncommunications, from 11 to 30 - for servers, and for DHCP, select a range from 31 to 254. That is, any address from the server issued to the client will only lie in this range. You can also configure exclusion addresses in the distributed range, and they will also not be distributed to client devices.
Next, before setting up a DHCP server, you need to decide what options it will distribute. Is there a need to distribute, for example, gateway or DNS parameters. After that, the data is entered on the server, its activation starts and the server starts distributing addresses.

Home DHCP server
Houses often use routers as a DHCP server, which distribute the content received from the provider to home appliances - computers, laptops, phones, TVs and other devices connected to the network by wired or wireless. This creates something like a virtual server that distributes addresses to users. From the outside, it looks as if one user has opened several pages in a browser on one of his computers. In this case, in fact, only one router is connected to the external network. This allows you to significantly save on the number of connected lines.

Setting up automatic addressing on the router
To set up automatic distribution of addresses to home devices, you need to connect the router to your computer (laptop) with a network cable. In any browser, we prescribe the address of the router (usually it is 192.168.0.1). In the proposedby default, enter “admin” in the login and password request fields (often these data are indicated in the router’s instruction manual). As a result, we will see the router settings menu. We go into the Lan or Network sections (the names may differ) and find the submenu with the DHCP settings. How to enable address distribution on the router? Just check the enable DHCP line and restart the router.

Configuring DHCP router
If the default settings do not suit you, you can change the parameter configuration. In the same menu where we enabled the address distribution function, you can enter the range of distribution of IP addresses, for example 192.153.0.1 - 192.153.0.3. For work, you can specify only two addresses, for example, for a laptop and a mobile phone. This limits the number of devices that can work at the same time, which is the simplest connection protection.
Next, set up the gateway (Gataway). This is the IP address of the device through which the Internet passes for devices. Usually this setting is the same as the IP address of the router.
After creating the basic settings, you need to save them and restart the router. The settings will take effect immediately after the reboot.
Before disabling DHCP, you need to make sure that the devices have static addresses set. To disable automatic distribution, uncheck the DHCP option in the router settings, save the changes and reboot the device.