DHCP setup under Linux

Source: Internet
Author: User

Set up DHCP

Install DHCP server: Yum install dhcp-y

Complete installation under File/etc/dhcp/dhcpd.conf

Vim/etc/dhcp/dhcp.confdefault-leaste-time 259200;max-lease-time 777600;option domain-name "Wangconggao";

The first and second lines define the default period and the maximum period for the lease, and the values are calculated in seconds, which is "three days" and "Nine days". The last line specifies the name that the network uses.

Subnet 192.168.20.0 netmask 255.255.255.0 {range 192.168.20.1 192.168.20.19;range 192.168.20.21 192.168.20.253;option Broadcast-address 192.168.20.255;option Routers 192.168.20.20;option domain-name-servers 192.168.20.20,219.141.136.10,219.141.140.10;}

Here, specify two scopes under the network (192.168.20.0), which is the IP range that allocates DHCP: 192.168.20.1 and 192.168.20.19 to 192.168.20.21 to 192.168.253, and I also specified '      Address of the broadcast address ', ' Router address ', and ' DNS '. Host Xiaohai {hardware Ethernet 48:54:e8:27:75:77;fixed-address 192.168.20.252;}

The client machine that obtains IP through DHCP, if its lease period has expired, then may lose the original IP, if I want to always use the original IP above method can be realized.

Then build the dhcp.leases file: touch/etc/dhcp.leases do not try to modify this file yourself, if you change the file has a problem, say it deleted or renamed. And then re-establish the file.

Restart DHCP server:/ETC/RC.D/INIT.D/DHCPD restart or: service dhcpd Restart See if there are any errors below if not stated successfully!

This article is from the "Wangconggao" blog, make sure to keep this source http://wangconggao.blog.51cto.com/3253868/1579677

DHCP setup under Linux

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.