What is DHCP? DHCP setup, options and configuration. How to enable or disable DHCP?

It is well known that in order to work with the network, each device, whether it be a computer, laptop, tablet or phone, must have a specific electronic identifier - an IP address, as well as configured mask, gateway and DNS server information. When connecting, the network interface immediately tries to get this address from special equipment that is engaged in the automatic distribution of addresses. If such equipment is not located, then the user has to enter the network parameters manually. If there are many computers on the network, then errors in addressing and duplication of addresses are possible, leading to system failures and slowing down the network performance as a whole. In the home network, in the absence of automatic distribution of addresses, you have to register the network parameters manually on each device to connect, for example, to a router. Not every user has sufficient knowledge and experience to correctly change such settings. Therefore, at home, many users also try to deploy automatic distribution of addresses, that is, deploy a DHCP server.

dhcp what is it

What is DHCP?

We will deal with this issue. In order to avoid errors during addressing, the Dynamic Host Configuration Protocol (DHCP) was implemented. This is a function that dynamically distributes network settings to connected client machines. If on these devices in the settings there is a parameter “receive IP address only from the 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 significantly 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 by default starts automatically when you turn on any device that supports wired or wireless network interfaces. For example, on tablets or phones, it’s enough to turn on Wi-Fi and among the found devices that distribute the Internet, find your own and connect to it. At the same time, automatic distribution of addresses eliminates duplication of IP and, as a result, helps to avoid network conflicts.

DHCP setting

How is the distribution of addresses

During the connection of any client device to the network, a special broadcast request is sent to the network in order to search for a DHCP server that distributes 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 the device that is responsible for distributing addresses to computers on the network to automatically apply them to various clients. If such a server is present, it creates a packet with a response to a client’s request, which can include settings such as IP address, network mask, gateway settings, DNS server addresses, domain name, etc. and sends this packet to the client device . The client receives a confirmation signal from the DHCP server. The generated data package is standardized, so it can be decrypted and used by almost any operating system.

The parameters issued by the server for the client device have a limited custom expiration period, which has its own name - “lease time”. Addresses issued by the server are analyzed for coincidence with valid addresses with unexpired lease times, so duplicate addresses are 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.

dhcp this

Client settings for automatic network settings in Windows

In order for the client to receive the response network parameters from DHCP, it is necessary 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 must be switched to the classic view) and select "Network Connections". We select the network connection 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 TCP / IP Internet Protocol Properties. DHCP is what? This is getting automatic network parameters. Therefore, we mark with dots the options for automatically obtaining the IP address and DNS. Having made a choice, click OK. DHCP configuration on the client is complete. Now the device will receive the address from the DHCP server automatically when Windows starts.

The DHCP setting in Windows 7 is set in the same way, but the location of the adapter properties is slightly different from Windows XP. We also go to Start - Control Panel - Network and Sharing Center. Select the item “Change adapter settings” in the left menu. Next - similar to the above 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 data exchange between the device and the DHCP server to pass, and make sure that the network settings are received and applied successfully. DHCP services on almost all devices are enabled by default.

If the connection does not occur, then you need to check the status of automatic reception of addresses. For example, on Android OS, for this you need to go to Settings - Wireless Networks - Wi-Fi Settings - Additionally and make sure that the option "use a static IP address" is disabled.

DHCP transmitted data

DHCP options are parameters that are passed from the server to the client. All these parameters passed are divided into categories. There are required options, such as IP address and netmask. There are non-configurable utility options, which, for example, show the beginning and end of options in the transmitted packet. At its core, options are typical key-value pairs that can be seen and configured in security policies.

The main DHCP parameters in the package, in addition to the IP address and mask, are 3 (Gateways), 6 (Domain Name Servers), 44 (NBT Name Servers), 46 (NBT Node Type). These parameters are group, 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.

how to configure dhcp

DHCP settings on the server

Before configuring the settings, it is necessary to perform several calculations of the main DHCP options. What are these options? - you ask. Options are all those network parameters that are transmitted from the server to the client. The two main options are a range of addresses to be distributed and a subnet mask. The entire range of organization addresses is usually divided into several segments intended 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 a working range of 192.168.1.1-192.168.1.254, you can determine addresses from 1 to 10 for communication, 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 lie only in this range. It is also possible to configure exception-addresses in the distributed range, and they will not be distributed to client devices either.

Next, before setting up a DHCP server, you need to decide what options it will still give out. Is there a need to distribute, for example, gateway or DNS parameters. After that, the data is entered on the server, its activation is launched, and the server begins the distribution of addresses.

how to disable dhcp

Home DHCP Server

At home, routers are often used as DHCP servers, which distribute content received from the provider to home equipment - computers, laptops, telephones, televisions, and other devices connected to the network by wire or wireless. This creates something like a virtual server that distributes addresses to users. From the outside, it looks as if one user opened several pages in a browser on one computer. Moreover, in fact, only one router is connected to the external network. This allows you to significantly save on the number of connected lines.

dhcp how to enable on the router

Setting automatic addressing on the router

To configure automatic distribution of addresses to home devices, you need to connect the router to a computer (laptop) with a network cable. In any browser, we register the address of the router (usually it is 192.168.0.1). In the suggested login and password request fields, enter “admin” by default (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 vary) and find the submenu with the DHCP settings. How to enable the distribution of addresses on the router? Just ticking the enable DHCP line and rebooting the router.

dhcp options

Configuring a DHCP router

If the default settings do not suit you, then you can change the configuration of the parameters. In the same menu where we turned on 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 concurrent devices, which is the easiest connection protection.

Next, configure the gateway (Gataway). This is the IP address of the device through which the Internet passes for devices. Usually this parameter is the same as the IP address of the router.

After creating the basic settings, you need to save them and reboot the router. Immediately after a reboot, the settings will take effect.

Before disabling DHCP, you must make sure that the devices have static addresses. To disable automatic distribution, you need to uncheck the DHCP parameter in the router settings, save the changes and reboot the device.

Source: https://habr.com/ru/post/K19820/


All Articles