Set up a DHCP server on centos7

Source: Internet
Author: User

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,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.