In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Basic principles of DHCP Services + dhcp Relay Preface:
DHCP (dynamic Host configuration Protocol) is a local area network protocol that is specially used to automatically assign TCP/IP parameters to computers in a TCP/IP network. The DHCP service avoids errors caused by manually setting IP addresses and address conflicts caused by assigning an IP address to multiple workstations. DHCP provides secure, reliable, and simple TCP/IP network settings, reducing the burden of configuring IP addresses.
One: benefits of using DHCP
1) reduce the workload of administrators.
2) avoid the possibility of input errors.
3) avoid IP address conflicts.
4) improve the utilization of IP address.
5) facilitate the configuration of the client.
6) when the network changes the IP address, there is no need to reconfigure the IP address of each user.
Second: the distribution mode of DHCP
(1) automatic allocation (Automatic Allocation), in which 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.
(2) dynamic allocation method (Dynamic Allocation), the DHCP server assigns an IP address with a time limit to the host. When the time expires or the host explicitly indicates to give up the address, the address can be used by other hosts.
(3) manual allocation (Manual Allocation), the IP address of the client is specified by the network administrator, and the DHCP server only tells the client host the specified IP address.
Three: install DHCP
(1) install dhcp software package
installation command: yum install dhcp-y
Main configuration file (core): / etc/dhcpd.conf
Execute the program: / user/sbin/
Perform parameter configuration: / etc/sysconfig/dhcpd
(2) Master configuration file
Global settings, acting on the entire DHCP server
Ddns-update-style none; dynamic default-lease-time 21600; default lease time 21600 seconds max-lease-time 43200; maximum lease term 43200 seconds option domain-name "domain.org"; domain name specified option domain-name-servers 202.106.0.20; assign DNS address to customer
Subent network segment declaration, the scope of the entire subnet segment
Range parameter: set the IP address pool for allocation option subnet-mask parameter: set the client subnet mask option rouyers parameter: set the client default gateway
Host host declaration, acting on a single host
Hardware ethernet parameter: specify the corresponding MAC address
Fixed-address parameter: specify reserved IP address 4: DHCP relay experiment
Experimental topology diagram:
1. First, open win10, win7 and linux on the virtual machine, and configure their corresponding interfaces correctly. Then configure the sw2 switch, divide each corresponding interface into vlan, configure the IP address of each vlan in the sw3, and do the relay of the dhcp, and the dhcp trunk is configured in the gateway interface. In DHCP, we need to install the dhcp software package, set the IP address, configure the dhcp file information, and finally achieve the interconnection of the whole network.
2 、 sw2
3 、 sw3
4. Configure DHCP
Configure on the corresponding virtual machine linux, the network card (network adapter) must be connected correctly, what I connect here is vmnet1. Install the dhcp package and configure the dhcpIP address and the contents of the configuration file.
Modify the IP address to enter the ens33 configuration file
After the IP address is configured, you need to enable dhcpd before it will take effect.
Modify the configuration file, first copy / usr/share/doc/dhcp-4.2.5/dhcpd.conf.example to / etc/dhcp/dhcpd.conf, and configure the dhcp file in the main configuration file
Enter the dhcp main configuration file
Check to see if the configuration is correct
After the configuration is complete, look at the IP address on win10, which is the address of the 10 network segment.
If you are not looking at the address of the 10 network segment, you can first release the IP address: ipconfig / releas and then re-obtain the IP address: ipconfig / renew, and you can see the IP address of the 10 network segment, as long as there is no misconfiguration.
Check the IP address on win7, which should be the IP address of the 20 network segment.
Finally, in the two virtual machines of windows, ping192.168.100.100 can communicate with ping to prove that the experiment is successful and the whole network is interconnected.
throughout the lab, it should be noted that when configuring sw3, do not forget to configure DHCP relay, you need to configure DHCP relay in the network interface. And the corresponding host must correspond to its own network card; when configuring the configuration file of DHCP and modifying the IP address, be careful not to cause the whole experiment error because of a letter or a punctuation mark.
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.