May 24, 2021 That's what Linux should learn
Dhcpd is a service program used in Linux systems to provide DHCP protocols. Although the DHCP protocol is powerful, the configuration steps for the dhcpd service program are simple, which greatly lowers the threshold for implementing dynamic host management services in Linux.
After confirming that the Yum software repository is configured, install the dhcpd service program:
Package Arch Version Repository Size
================================================================================
Installing:
dhcp x86_64 12:4.2.5-27.el7 rhel 506 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 506 k
Installed size: 1.4 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 12:dhcp-4.2.5-27.el7.x86_64 1/1
Verifying : 12:dhcp-4.2.5-27.el7.x86_64 1/1
Installed:
dhcp.x86_64 12:4.2.5-27.el7
Complete!
查看dhcpd服务程序的配置文件内容。
[root@linuxprobe ~]# cat /etc/dhcp/dhcpd.conf
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
Yes, you're not mistaken! T here are only three lines of comment statements in the configuration file of the dhcp service program, which means that we need to write this file ourselves. If the reader doesn't know how to write it, take a look at the reference sample file for line 2 in the configuration file, which consists of a schema shown in Figure 14-2.
Figure 14-2 the schema of the dhcpd service provider profile
A standard profile should include global configuration parameters, subnet segment declarations, address configuration options, and address configuration parameters. Where the global configuration parameters are used to define the overall operating parameters of the dhcpd service program, the subnet segment declaration is used to configure the address properties of the entire subnet segment.
Considering that there are many parameters available for the dhcpd service program profile, Mr. Liu selected the most commonly used parameters (see Table 14-1) and introduced them briefly one by one to provide a good basis for the next experiment.
Table 14-1 the common parameters used in the dhcpd service program configuration file and their effects
Parameter Act ddns-update-style type Defines the type of dynamic update for DNS services, including: none (no dynamic updates supported), interim (interactive update mode) and ad-hoc (special update mode) allow/ignore client-updates allow/ignore clients to update DNS records default-lease-time 21600 default timeout max-lease-time 43200 maximum time-out option-name-servers 8.8.8.8.8 define DNS server address domain-domain.org define DNS domain name range defines the client's subnet-mask for the assigned IP address pool option subnet-mask defines the client's subnet mask option routers define the client's gateway address B roadcast-address broadcast address Define the client's broadcast address ntp-server IP address Define the client's network time server (NTP) nis-servers IP address Define the client's NIS domain server address hardware hardware type MAC address Specify the type of network card interface and MAC address server-name host name to the DHCP client to notify the DHCP server's host name fixed-address IP address to assign a fixed IP address to the specified host time-offset offset. Ask bold questions!
Because readers have different hardware or operation errors may lead to experimental configuration errors, please be patient and take a closer look at the operation steps, do not be discouraged
Linux technical exchange please add Group A: 560843 (full), Group B: 340829 (recommended), Group C: 463590 (recommended), click here to view the national group.
This group features: through password verification to ensure that each group member is "Linux should learn" readers, more targeted, from time to time free to receive customized gifts.