Linux DHCP Server Setup

Source: Internet
Author: User

DHCP is a Dynamic Host Configuration protocol that automatically assigns IP addresses, subnet masks, gateways, and DNS TCP/IP information.

Server IP 192.168.1.201

Test requirement: The Linux DHCP server is required to assign an IP address to a Linux client.


First of all:

Yum Install dhcp-y DHCP package

CD/ETC/DHCP Entering the DHCP folder

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8A/AE/wKiom1g28lryV4tZAAAQQMXirdI305.png "style=" float: none; "title=" 1.png "alt=" Wkiom1g28lryv4tzaaaqqmxirdi305.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8A/AA/wKioL1g28lqAejkRAAAbxe3AB1Q104.png "style=" float: none; "title=" 2.png "alt=" Wkiol1g28lqaejkraaabxe3ab1q104.png "/>

We can see the contents of the dhcpd.conf file next

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8A/AA/wKioL1g281_SanGRAAAV4VRhDDY347.png "title=" 3.png " alt= "Wkiol1g281_sangraaav4vrhddy347.png"/>

Make a copy of this catalogue.

VI dhcpd.conf modified to the following line (simple)

The first line in the red box is the name. The second line is DNS can be modified by itself

Third Row IV behavior lease time size can be modified by itself

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8A/AE/wKioL1g3uYKScLKLAABDDs7EfgE645.png "style=" float: none; "title=" 8.png "alt=" Wkiol1g3uyksclklaabdds7efge645.png "/>

The first behavior in the red box is the subnet mask after the self-assigned address network segment

The second line is the range of assigned addresses that you can choose. I'm choosing 220-230.

The third line is the gateway address, you can ping the extranet

The third-step gateway can be configured here as well as above, and at the top it is globally effective

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8A/B2/wKiom1g3uYPwbqYGAAAg9_yjWLc887.png "style=" float: none; "title=" 9.png "alt=" Wkiom1g3uypwbqygaaag9_yjwlc887.png "/>

After all this work, you can use the command to comment out all the contents below.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8A/AE/wKioL1g3vNWw9nsUAAAKBCB10sQ219.png "title=" 10.png "alt=" Wkiol1g3vnww9nsuaaakbcb10sq219.png "/>

That is, save exit can also be viewed outside to confirm there are no errors

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/8A/B2/wKiom1g3vTSxRV9wAAAlfrsMeLE560.png "title=" 7.png " alt= "Wkiom1g3vtsxrv9waaalfrsmele560.png"/>

Restart DHCPD/ETC/INIT.D/DHCPD Restart after error

It can then be obtained with other machines (of course, the settings in the Ifcfg-eth0 are for DHCP).

You can then use the command dhclient-d to get the IP address

Get finished to see IP also available IP a look again

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8A/AE/wKioL1g3vZuDuh3-AABCPPYzVgA081.png "title=" 11.png "alt=" Wkiol1g3vzuduh3-aabcppyzvga081.png "/>

Of course, the last few steps are not obvious. But you can do it all by yourself to see the process clearly. Correct.

The above is the simplest DHCP server setup.

Linux DHCP Server Setup

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.