Linux Learning essay--linux setting up a DHCP server in the environment

Source: Internet
Author: User

2015.8. 30

DHCP (Dynamic Host Configuration Protocol) is a LANof theNetwork Protocol, usingUDPprotocol work, main purpose: to the internal network orNetwork ServicesAutomatic Vendor AssignmentIP Address. DHCP has 3 ports, where UDP67 and UDP68 are normal DHCP service ports, respectively, as DHCP server and DHCP Client service ports

The DHCP server requires the TCP/IP protocol to be installed, and the static IP address subnet mask and default gateway need to be set

To build a DHCP server:

one. Settings DHCP server IP address

Vi/etc/sysconfig/network-scripts/ifcfg-eth0 to configure an IP address, such as: To configure a 192.168.10.1 IP address for eth0

device=eth0//IP address configured for this NIC;
bootproto=static//This NIC interface is a static IP address or a dynamic IP address, statically static, dynamic for DHCP;
HWADDR=00:0C:29:3A:E3:B7//MAC address of this network card;
ipaddr=192.168.10.1//static IP address;
netmask=255.255.255.0//subnet mask for IP address above;

Service Network Restart Restart the NIC for it to take effect


Second, modify the DHCP configuration file: vi/etc/dhcp/dhcpd.conf

The first time you modify the configuration file tip let me refer to/usr/share/doc/dhcp*/dhcpd.conf.sample, copy a template to overwrite the original configuration file with CP/usr/share/doc/dhcp*/ dhcpd.conf.sample/etc/dhcp/dhcpd.conf

Ddns-update-style none;
Ignore client-updates;

Subnet 192.168.10.0 netmask 255.255.255.0 {//DHCP assignment to 10 segments
option routers 192.168.10.1; 10 Gateway for network segment
option Subnet-mask 255.255.255.0;//Subnet Mask
#option domain-name "linux.com";
#option domain-name-server 192.168.10.1;

range 192.168.10.100 192.168.10.254; DHCP address pool
default-lease-time 21600;
max-lease-time 43200;

Host User1 {
Hardware Ethernet 00:0c:12:0f:1d:ce; #对该用户进行IP绑定
fixed-address 192.168.1.5;
    }
}

Restart Dhcp:service dhcpd Restart

Linux Learning essay--linux setting up a DHCP server in the environment

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.