Set up a DHCP server on centos7
In recent years, I want to build a complete Intranet in a virtual environment.
At present, the server has set up LNMP and DHCP
Which of the DNS has been tossing for a long time last night, but it has not passed yet. I plan to try again tonight. So I will replace it with win2008.
Write this article. The first is to take notes. The second is to take notes. There are still unsolved questions. I hope you can answer them for me. The third is to share it with us, who are also white.
Enter the subject
Environment or centos7 x64
Netease yum is used. First, let's install yum-y install dhcp.
After installation
Configuration file path/etc/dhcp. dhcpd. conf
There will be three lines of comments after opening. After translation, I forget what it means. It doesn't matter.
Below we will manually write the configuration file. There are not many requirements for beginners. So we can allocate a network segment.
subnet
192.168.
100.0 netmask
255.255.
255.0{# This is the subnet and mask allocation
range
192.168.100
. 20
192.168.100
. 230;
# The IP address assigned to the client ranges from 192.168.100.20 to 192.168.100.230.
option routers
192.168.100
. 1;
# Set a gateway
default-lease-time
600;
# Default lease time
max-lease-time
7200;
# Maximum lease time
}
After the settings are complete, we start the service.
I use service dhcpd start
An error is reported when it is enabled. It is estimated that it is related to the environment variable settings.
Later, systemctl start dhcpd. service was started successfully.
One problem is how to write the configuration file to the automatically assigned DNS ip address,