In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Learn about DHCP services
DHCP (Dynamic Host Configuration Protocol, dynamic host configuration protocol) is usually used in large-scale local area network environment, and its main function is to centrally manage and assign IP addresses, so that hosts in the network environment can dynamically obtain IP addresses, Gateway addresses, DNS server addresses and other information, and can improve the utilization of addresses.
2. Benefits of DHCP
L reduce the workload of administrators
L avoid the possibility of typing errors
L avoid IP conflicts
L improves the utilization of IP addresses
L facilitate the configuration of the client
3. How DHCP is allocated
L automatic allocation
The DHCP server assigns a permanent IP address to the host, which can be permanently used once the DHCP client successfully leases the IP address from the DHCP server for the first time.
L manual assignment
The IP address of the client is specified by the network administrator, and the DHCP server simply tells the client host the specified IP address.
L dynamic allocation
The DHCP server assigns an IP address with a time limit to the host, which can be used by other hosts when the time expires or when the host explicitly abandons the address.
4. The lease process of DHCP
The DHCP protocol uses UDP as the transmission protocol, the host sends the request message to the DHCP server, and the DHCP server responds to the reply message to the host. The detailed interaction process is shown in the following figure.
L client request
The Dhcp client sends out DHCP Discover messages by broadcast
All DHCP Server can receive the DHCP Discover message sent by DHCP Client, and all DHCP Server will respond by sending a DHCP Offer message to DHCP Client.
L server response
After DHCP Server receives the DHCP Request message, it determines whether the IP address in the option field is the same as its own address. If it is different, DHCP Server does nothing but clear the corresponding IP address allocation record; if it is the same, DHCP Server responds to a DHCP ACK message to DHCP Client and adds the lease information of the IP address to the option field.
L client selects IP
After receiving the DHCP ACK message, the DHCP client checks whether the IP address assigned by DHCP Server can be used. If it can be used, the DHCP client successfully obtains the IP address and automatically starts the renewal process based on the IP address; if the DHCP client finds that the assigned IP address has been used, the DHCP client sends a DHCP Decline message to DHCPServer, informing DHCPServer to disable the IP address, and then the DHCP client starts a new address application process.
L the server determines the lease
After successfully obtaining the IP address, the DHCP client can release its IP address at any time by sending a DHCP Release message. After receiving the DHCP Release message, DHCP Server will collect the corresponding IP address and reassign it.
It should be noted that when the lease term exceeds 50%, the DHCP client will send a DHCPRequest message to DHCP Server in unicast form to renew the IP address. If the DHCP client successfully receives the DHCP ACK message sent by DHCP Server, the lease of the IP address is extended by the corresponding time; if the DHCP ACK message sent by DHCP Server is not received, DHCP Client continues to use this IP address.
When the lease term exceeds 87.5%, DHCP Client will send DHCPRequest messages to DHCP Server in the form of broadcast to renew the IP address. If DHCP Client successfully receives the DHCP ACK message sent by DHCP Server, the lease period of the IP address is extended according to the corresponding time; if the DHCP ACK message sent by DHCP Server is not received, DHCP Client continues to use this IP address until the lease term of the IP address expires. DHCP Client will not send DHCP Release message to DHCP Server to release the IP address and start a new IP address application process.
It is important to note that DHCP clients can receive DHCPOFFER packets from multiple DHCP servers, and then may accept any DHCPOFFER packet, but the client usually accepts only the first DHCPOFFER packet received. In addition, the address specified in the DHCP server DHCPOFFER is not necessarily the final assigned address, and typically the DHCP server retains the address until the client makes a formal request.
Formally requesting the DHCP server to assign an address DHCPREQUEST uses a broadcast packet so that all other DHCP servers that send DHCPOFFER packets can receive the packet and release the IP address that has been OFFER (pre-allocated) to the client.
If the address sent to the DHCP client is already in use by another DHCP client, the client sends a DHCPDECLINE packet to the server to refuse to accept the assigned address information.
During the negotiation process, if the address information in the REQUEST message sent by the DHCP client is incorrect, such as the client has migrated to a new subnet or the lease has expired, the DHCP server will send a DHCPNAK message to the DHCP client to ask the client to re-initiate the address request process.
5. Installation of DHCP
Installation requirements for DHCP
L server has static IP
L need to authorize DHCP services in a domain environment
Use windows server 2016 as a reference
Open the server manager for server2016
Click to add roles and features
There is no need to adjust after clicking to add roles and features. Stand-alone is the next step
Default selection of role-based or feature-based installation
Select a server from the server pool
Click next to come to the new interface.
Check the DHCP server and click next.
You can install it by default in the next step.
After installation, DHCP can be opened in the server manager dashboard to manage the following figure
6. Configure the DHCP service
Open the DHCP console window. Right-click the DHCP server name in the left pane and execute the New scope command.
Step 2 Click the next button in the New scope Wizard dialog box that opens to open the active Domain name wizard page. Type a name (such as CCE) and a piece of descriptive information for the scope in the name box, and click the next button.
Step 3 opens the IP address range wizard page, and type the pre-determined IP address range in the start IP address and end IP address edit boxes, respectively. Then you need to define the subnet mask to determine the number of bits in the IP address that are used for the Network / Subnet ID. Click the next button
Step 4 you can specify the excluded IP address or range of IP addresses on the add exclusion wizard page that opens. Type the excluded IP address in the start IP address edit box and click the add button. Just repeat, and then click the next button.
Step 5 in the lease term wizard page that opens, by default, the IP address obtained by the client is limited to 8 days. If there are no special requirements to leave the default value unchanged, click the next button.
Step 6 opens the configure DHCP options wizard page, leaving the Yes, I want to configure these options now radio box and clicking the next button. Type the gateway address based on the actual situation in the Router (default Gateway) wizard page that opens and click the add → next button.
Step 7 does not make any settings in the Domain name and DNS Server wizard page that opens because the DNS server is not installed on the network and has not been upgraded to domain management mode. Click the next button to skip the WINS Server wizard page to open the activate scope wizard page. Leave the "Yes, I want to activate this scope" radio box selected, and click the "next" → "finish" button to end the configuration.
After setting up the DHCP client to install the DHCP service and create the IP scope, in order to use the DHCP method to assign the IP address to the client computer, in addition to having a DHCP server in the network, the client computer should have the ability to automatically obtain the IP address from the DHCP server. These client computers are called DHCP clients.
So we made the following settings for a client computer running Windows: right-click the "Network neighbor" icon on the desktop and execute the "Properties" command. In the Network connection window that opens, right-click the Local connection icon and execute Properties to open the Local connection Properties dialog box. Then double-click the Internet Protocol (TCP/IP) option, click the automatically obtain IP address check box, and click the OK button.
Then use Wireshark to grab the DHCP package and see how to get it
At this point, the DHCP server and client are all set up. When the DHCP server is running normally, the client that boots for the first time will automatically obtain an IP address and have an eight-day expiration date.
Of course, DHCP servers can be built not only by windows server, but also by using LINUX to build https://blog.51cto.com/9075724/2298150
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.