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