In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Principle and experiment of DHCP
I. DHCP principle
1. DHCP (dynamic host configuration protocol)
Dynamic host configuration protocol, mainly a protocol for automatically assigning TCP/IP parameters to computers in a network.
2. TCP/IP configuration provided by DHCP
IP address, subnet mask, gateway, DNS
3. Benefits of using DHCP
reduces the workload of administrators
avoids the possibility of typing errors
avoids IP conflicts
provides utilization of IP addresses (final)
facilitates client configuration
4. The distribution mode of DHCP
is automatically assigned and permanently used after an IP address is assigned.
is manually assigned, and the DHCP server administrator specifically specifies the IP address to use.
dynamic allocation, release IP after use for other customers to enhance the flexibility of IP allocation and improve IP address utilization
5. The DHCP lease process is divided into four steps
client requests IP (broadcast and unicast, server2016 broadcast, Linux two broadcasts and two unicast)
server response
client chooses IP
The server determines the lease (why IP is not repeatedly assigned to other clients)
Note: minimizing broadcasts will increase the burden on servers and clients
5.1. DHCP lease process 1:
(1) DHCP client broadcasts request IP address, source IP address: 0.0.0.0, destination address 255.255.255.255 (here all hosts in the network)
(2) DHCP server response, source IP address: 192.168.10.10 (here refers to the server's IP address), destination IP address: 255.255.255.255, provided IP address: 192.168.10.101 (DHCP client)
(3) client selects IP address, client broadcasts, selects DHCP server (192.168.10.10), source address: 0.0.0.0, destination address 255.255.255.255, determine lease term: 8 days
(4) the server confirms that the source IP address is 192.168.10.10 and the destination IP address is 255.255.255.0
5.2. DHCP lease process 2 (client restart):
First, after the client restarts, send the DHCP Request request packet with the IP address.
If the previously assigned IP address is not used, a DHCP ACK confirmation message is sent, and the client can continue to use the IP address before restart
If the previously assigned IP address is already occupied by another client, send a DHCP Nack denial message and repeat the steps in figure 5-1
6. Renew the lease
After the lease term of the IP address reaches 50%, the lease term must be renewed. The client sends the DHCP Request request packet directly to the server.
2. DHCP experiment
1. Installation of DHCP service
(1) Open the server2016 in the virtual machine
(2) add roles and functions
(3) install DHCP server
(4) Open the Windows management tool
(5) when DHCP occurs, the installation service is completed.
2. Build DHCP service
(1) create a new scope
(2) exclude IP addresses that do not need to be used
(3) configure the duration of leased IP addresses
(4) configure the gateway
(5) configure DNS
(6) configure wins server
(7) activate scope
2. Configure the network card information
(1) configure the IP address of the server2016 server
(2) configure the address of the virtual network card from the host (local)
Note:
The network adapters for server and win7 systems in the ① virtual machine must be set to the same virtual network card (such as VMnet1)
② enters the virtual machine network editor to turn off the DHCP function of the virtual network card itself.
(3) set the local Nic in win7 to obtain automatically
(4) DHCP service assigned IP address successfully
The client can view various information about configuring the DHCP service, the lease time, the IP address of the DHCP server, DNS, and the address of the WINS server, and the server can also view the client that rents the IP address.
3. Set the reservation
(1) create a new reservation
(2) set reserved IP address and mac address
Note: the MAC address is the physical address of the client, which can be viewed from the status of the client's network.
(3) verify that the reservation is effective.
4. There are four steps to verify the DHCP service with the package grab wireshark tool.
Here are the four steps of the DHCP service lease:
(1) DHCP client sends Discover request for IP lease in the form of broadcast.
(2) after receiving the Discover request, DHCP will send a DHCP Offer message to the client in response, which contains the IP address that the DHCP server can provide to the DHCP client and the IP address information of the DHCP server itself.
(3) the DHCP client selects the first received DHCP Offer for processing, and sends the DHCP Request message in the form of broadcast, which is added to the address of the corresponding DHCP server and the required IP.
(4) after receiving the DHCP Request message, the DHCP server will determine whether the server IP in the message is the same as itself. If different, no processing is done, only the corresponding IP allocation record is cleared; if the same, the server will send an ACK message to the client to confirm that it can be used, and attach the lease period of the response.
Note: before grabbing the package, the client needs to clean up the cache of the network card and retrieve the ipconfig/renew through the cmd command ipconfig/ release, so that the complete packet grabbing process can be obtained through the packet grabbing tool.
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.