In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to quickly deploy a DHCP server under Linux". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to quickly deploy a DHCP server under Linux".
Test environment settings
In this step, we will use the following test environment.
DHCP Server-Ubuntu 16.04DHCP Clients-CentOS 7 and Fedora 25 step 1: install the DHCP server in Ubuntu
1. Run the following command to install the DHCP server package, which is dhcp3-server.
$sudo apt install isc-dhcp-server
2. After the installation is complete, the editor / etc/default/isc-dhcp-server uses the INTERFACES option to define the interface that DHCPD uses to respond to DHCP requests.
For example, if you want the DHCPD daemon to listen to eth0, set it as follows:
INTERFACES= "eth0"
Also remember to configure a static address for the interface above.
Step 2: configure the DHCP server in Ubuntu
3. The main file of DHCP configuration is / etc/dhcp/dhcpd.conf. You must fill in all the network information that will be sent to the client.
And two different declarations are defined in the DHCP configuration, which are:
Parameters-specifies how and whether to perform the task, as well as the network configuration options to be sent to the DHCP client. Declarations-define a network topology, specify a client, provide an address for a client, or apply a set of parameters to a set of declarations.
4. Now open and modify the main file to define the DHCP server options:
$sudo vi / etc/dhcp/dhcpd.conf
Set the following global parameters at the top of the file, which will be applied to all of the following declarations (please specify a value that applies to your situation):
Option domain-name "tecmint.lan"; option domain-name-servers ns1.tecmint.lan, ns2.tecmint.lan;default-lease-time 3600bot maxMuraseMutual time 7200 poster authorship
5. Now define a subnet. Here we set the DHCP for 192.168.10.0 and 24 LAN (please use the parameters applicable to your situation):
Subnet 192.168.10.0 netmask 255.255.255.0 {option routers 192.168.10.1; option subnet-mask 255.255.255.0; option domain-search "tecmint.lan"; option domain-name-servers 192.168.10.1; range 192.168.10.10 192.168.10.100; range 192.168.10.110 192.168.10.200 } step 3: configure a static address on the DHCP client
6. To assign a fixed (static) IP to a specific client, you need to explicitly add the machine's MAC address and the statically assigned address to the following section.
Host centos-node {hardware ethernet 00VOV F0 fixed-address m4VERV 6yLV 89G; fixed-address 192.168.10.105;} host fedora-node {hardware ethernet 00VOV 4g RV 8hRV 13hRV 3a; fixed-address 192.168.10.106;}
Save and close the file.
7. Next, start the DHCP service and let it boot itself next time, as shown below:
-SystemD-$sudo systemctl start isc-dhcp-server.service$ sudo systemctl enable isc-dhcp-server.service- SysVinit-$sudo service isc-dhcp-server.service start$ sudo service isc-dhcp-server.service enable
8. Next, don't forget the firewall permissions that allow the DHCP service (the DHCP daemon listens on port 67 UDP):
$sudo ufw allow 67UDP $sudo ufw reload$ sudo ufw show step 4: configure the DHCP client
9. At this point, you can configure the client computer to automatically receive IP addresses from the DHCP server.
Log in to the client and edit the configuration file for the Ethernet interface (note interface name / number):
$sudo vi / etc/network/interfaces
Define the following options:
Auto eth0iface eth0 inet dhcp
Save the file and exit. Restart the network service (or restart the system):
-SystemD-$sudo systemctl restart networking- SysVinit-$sudo service networking restart
You can also use GUI to set the settings, as shown in the screenshot (on the Fedora 25 desktop), to automatic (DHCP).
At this point, if all the settings are complete, your client should be able to automatically receive the IP address from the DHCP server.
Thank you for reading, the above is the content of "how to quickly deploy DHCP server under Linux". After the study of this article, I believe you have a deeper understanding of how to quickly deploy DHCP server under Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.